A longtime Baltimore public works employee has agreed to pay $6 million in restitution as part of a guilty plea to accepting bribes from trash haulers for nearly his entire 30-year career, federal prosecutors said.

William Charles Nemec Sr., 55, pleaded guilty to conspiracy and solicitation of bribes in U.S. District Court, in connection with a scheme in which public works employees took cash payments from commercial haulers, allowing them to avoid thousands in fees to dump trash.

Nemec also admitted to participating in a scheme in which employees stole scrap metal from the landfill, prosecutors said.

Nemec began working as a scale house cashier in 1984, and said he and other cashiers would "regularly accept bribes from small and large haulers in lieu of charging disposal fees and then split the bribe money among all cashiers," prosecutors said.

"Except for short periods of time over the years since 1984, and despite the comings and goings of new scale house employees and supervisors at the landfill, Nemec and other scale house operators continued to execute the bribery scheme until Nemec's arrest on May 12, 2015," prosecutors said.

While Nemec and the other employees received bribes of about $100, the city lost out on millions in revenue.

Nemec will be sentenced on Nov. 17, and faces up to five years in prison for the conspiracy and 10 years for the bribery count.

Tamara Oliver Washington, 55, previously pleaded guilty and also agreed to pay $6 million in restitution. Two others who have pleaded guilty — Mustafa Sharif, 63, and Adam Williams Jr., 52, agreed to pay $500,000 and $900,000, respectively.