HAMPDEN, Maine — At a time when alternative, cost-effective energy sources are on everybody’s mind, the idea of turning once-unusable waste into power is a reason to give pause.

The Pine Tree Landfill in Hampden held an event on Tuesday to declare that its gas-to-energy facility that has been on line for about six months is a monumental success.

“Electricity powered by trash. That’s pretty neat,” Hampden Mayor Rick Briggs said Tuesday at an open house and tour of the facility, the first in Maine.

Solid waste has been stored for decades at the expansive — and often unpopular — landfill in Hampden. Mostly, the waste was trucked in and left to decompose and fester, creating an unpleasant odor and what some felt was an eyesore.

When it became clear the landfill was nearing its capacity, however, the town and landfill operator Casella Waste Systems came up with a way to keep the landfill not only economically viable but environmentally productive.

“What you are seeing here is huge; it’s a huge investment,” Gov. John Baldacci said in brief remarks at Tuesday’s open house. “This is such a win for the community.”

The landfill broke ground last year on the gas-to-energy extraction facility and began creating an elaborate network of wells and pipes that connect the interior of the landfill to the extraction plant.

The concept is relatively simple: Methane gas produced by the decomposing waste is transferred to an extraction plant where it is cleaned and then used to power generators that make electricity. As part of an agreement, that energy is added to the New England power grid, and so far the facility has created enough electricity to power up to 3,000 homes for 15 years.

Don Meagher, Casella’s manager of planning and development, said landfills historically have been thought of as cemeteries for waste, but that’s changing.

“What we’re doing here at the Pine Tree Landfill is transforming a renewable resource into real economic and environmental benefits,” he said.

The last few months have highlighted a full-circle relationship between Casella and the town of Hampden, which has been the landfill’s steward since the 1970s. At times, that marriage was tenuous at best, but the recent collaboration has created the best situation possible, both sides agreed.

“I think the closure agreement between the town and Casella really created a frame-work for effective communication between the two sides,” Hampden Town Manager Sue Lessard said. “It has taken a lot of years, but obviously we’re in favor of keeping the landfill as a business and an employer in town.”

Jim Bohlig, Casella’s chief development officer, agreed.

“It took awhile to decide what the future of this landfill would be, but I think once we realized what was possible, everyone fell in line,” he said.

The landfill is expected to reach capacity sometime next year, but by investing about $10 million into the new gas-to-energy facility, Bohlig said the landfill will continue to operate and create electricity for 20 years or more.

The situation at Pine Tree Landfill could serve as a model for other facilities throughout the state, including the Juniper Ridge Landfill in Old Town, which also is managed by Casella Waste Systems.

“This is the first project of its kind in the state, but it won’t be the last,” Bohlig said. “This could really be a wave of the future.”