First, Prince William County residents toss their garbage into cans. Then trash trucks pick it up and take it to the county’s Independent Hill landfill, where it’s left to rot.

But the story doesn’t end there.

Since 1998, New York-based Fortistar, a renewable-energy company, has helped the county capture the methane gas created by decomposing garbage and turn it into electricity.

Fortistar recently added three diesel engines to the gas-to-energy facility at the landfill off Dumfries Road in the Manassas area, bringing the total to five. The $10 million project — which was launched with a ribbon-cutting ceremony Dec. 4 — is expected to help power 5,000 to 6,000 homes, said Tom Smith, who heads the county’s solid-waste division.

The county receives funds for gas rights, as well as a share of the electricity revenue — about $13,000 per year, a county statement said.

The technology used at the landfill has been around for decades. The process works like this: Underground tubes capture the methane, which travels to wells dotted across the landfill. A huge vacuum pulls the gas from the wells and through piping to the landfill’s engines, said David Comora, a Fortistar spokesman.

The specially fitted diesel engines turn the gas into power that is transferred at a price to Northern Virginia Electric Cooperative, the electricity distributer in the area.

Supervisor Martin E. Nohe (R-Coles) said the project represents a little-known facet of local government.

“We monitor the streams, we build the roads, those are the things we talk about,” Nohe said in a statement. “Most Americans don’t want to think about a lot of what we do. . . . Something that I think should be a great source of pride is we turn our garbage into a world-leading energy resource. What we do here is fantastic.”

Comora said Prince William’s project is one of the largest in the state.

“It’s a small niche,” Comora said of landfill renewable energy projects. “That doesn’t necessarily make it unimportant or [mean that] it shouldn’t be done. It can be done very cost effectively and very safely. It’s taking a product you would just do nothing with and [turning] it into something.”

Smith said more than 1,000 tons of trash are delivered to the landfill daily. “We’ve taken what seems to be a negative,” he said, “and turned it into a positive.”