BALTIMORE (WJZ) — Former Maryland Senator Nathaniel T. Oaks has pleaded guilty to charges in connection with a federal bribery case.

Oaks pleaded guilty to two counts of wire fraud, and in return, the remaining eight charges were dropped.

READ MORE: WATCH LIVE: Swearing-In Ceremony For Annapolis Mayor Gavin Buckley

He will be sentenced in July, and he faces a maximum of 20 years in prison on each count, which will likely be reduced in the plea deal when he is sentenced.

RELATED: Baltimore Sen. Nathaniel Oaks To Resign From Md. General Assembly

Oaks sat in the Maryland Senate for the last time Wednesday night.

On Thursday, his name is gone from the roll call after he formally resigned to Senate President Mike Miller.

Two hours later, Oaks was walking into federal court to plead guilty to two counts of wire fraud.

READ MORE: Derby Winner Medina Spirit, Who Underwent Strict Testing Ahead Of Preakness, Collapses, Dies In California

He struck a deal with prosecutors that dropped eight other counts, including obstruction of justice.

Federal prosecutors allege the Baltimore Democrat took $15,300 in bribes from an informant posing as a Texas investor.

The guilty pleas match indictments that in September 2015, Oaks met with an FBI confidential source and agreed to assist the source with a business development in Maryland.

Between April and July 2016, Oaks issued fraudulent letters using house of delegate letter head to obtain federal funds for the FBI source, who paid Oaks more than $10,000 for his help.

Then in September 2016, Oaks filed for a request for $250,000 in state funds for the source’s project. He was paid another $5,000 in cash.

Oaks was indicted last year, but had continued to take his seat in the Senate. Last month, the Senate president removed him from the Senate Finance Committee.

MORE NEWS: Supply Chain Issues: How Are Global Shortages Affecting Local Customers?

Follow @WJZ on Twitter and like WJZ-TV | CBS Baltimore on Facebook