Then-Maryland Del. Nathaniel T. Oaks (D-Baltimore City) during a hearing in the House of Delegates in Annapolis in February 2009 (Glenn Fawcett/The Baltimore Sun/AP)

Former Maryland state senator Nathaniel T. Oaks was sentenced to 3½ years in federal prison Tuesday after he acknowledged taking bribes in exchange for helping a developer secure government funding for a project.

Oaks, 71, pleaded guilty to two counts of wire fraud in the corruption case and resigned from the Senate in March.

The case stems from deals Oaks made with a man introduced to him as a real estate developer but who was actually a confidential FBI source, according to his plea agreement.

The developer claimed to have interest in contracts in Baltimore and paid Oaks $10,300 for letters to help the businessman obtain federal grant funds from the U.S. Department of Housing and Urban Development in the spring and summer of 2016, his plea states.

In September 2016, Oaks accepted $5,000 in exchange for helping the businessman secure $250,000 in state money for the project, his plea states.

When confronted by the FBI about the bribes, Oaks agreed to cooperate with authorities and record his conversations as part of a different investigation, the government said. But twice Oaks tried to tip off the target of the investigation, actions that upended investigations into other politicians, the government said.

An attorney for Oaks could not be reached for comment.