Baltimore State's Attorney Marilyn Mosby lost her reelection bid to defense attorney Ivan Bates in the Democratic primary after she was indicted by a grand jury on federal charges alleging that she used coronavirus hardship as a reason to take money out of her city retirement account.

The Associated Press called the race in favor of Ivan Bates, a defense attorney, on Friday night. Bates is a former prosecutor in Baltimore who served from 1996 to 2002 before becoming a defense attorney.

Mosby, a Democrat, directed her office to stop prosecuting offenses such as drug possession, prostitution, urinating in public, and more during the coronavirus pandemic in an attempt to stop the virus from spreading in jails and prisons.

She gained national popularity when she served as the prosecutor in the Freddie Gray case in 2015. Gray was an Black man who died in police custody.

BALTIMORE STATE'S ATTORNEY MARILYN MOSBY INDICTED ON FEDERAL CHARGES

Marilyn Mosby speech

Maryland State Attorney Marilyn Mosby speaks during a news conference in Baltimore in December 2019.  (AP/Julio Cortez)

Mosby was indicted in January on charges of perjury and making false mortgage applications, both relating to vacation home purchases in Florida.

Court documents state that Mosby allegedly lied when citing coronavirus hardship as a reason to make withdrawals from her city retirement account and allegedly certified that she met at least one qualification for distribution under the CARES Act and "affirm[ed] under penalties for perjury the statements and acknowledgments made in this request." 

Mosby allegedly requested two one-time withdrawals of $40,000 and $50,000 out of her city retirement account, which resulted in deposits of $36,000 and $45,000 into her bank accounts. 

Federal prosecutors allege Mosby then used the money for down payments on two separate vacation homes in Florida.

The indictment states that Mosby did not experience any adverse financial consequences from the coronavirus pandemic, and received her full salary of $247,955.58 from Jan. 1, 2020 all the way through Dec. 29, 2020.

BALTIMORE PROSECUTOR MARILYN MOSBY FACES STAFFING CRISIS AMID CRIMINAL CHARGES AND UPHILL REELECTION BATTLE

Marilyn Mosby

Baltimore State's Attorney Marilyn Mosby addresses the media outside her office on a day after her indictment on federal perjury charges. (Jerry Jackson/The Baltimore Sun via AP, File)

Prosecutors also alleged that Mosby lied on two mortgage applications, failing to disclose that she had unpaid federal taxes from previous years in addition to the IRS placing a $45,022 lien against all property that Mosby and her husband owned.

Mosby is also accused of lying in order to get a lower interest rate on the mortgage for her Kissimmee, Florida, vacation home by claiming it was a second home. Prosecutors allege that prior to claiming the "second home rider," Mosby entered an agreement with a vacation home management company that gave the company control over renting out the property.

If Mosby is convicted, she could face up to five years in prison for the two counts of perjury and up to 30 years in prison for each of the two counts of making false mortgage applications, according to the Department of Justice.

CLICK HERE TO GET THE FOX NEWS APP

Ivan Bates talking with man

Candidate for Baltimore City States Attorney Ivan Bates shares a laugh with members of his team outside the William Pace Elementary voting location on Tuesday.  (Kevin Richardson/Baltimore Sun/Tribune News Service via Getty Images)

Mosby's attorney, A. Scott Bolden, initially told FOX 45 in a statement that his client did nothing wrong. 

"Marilyn Mosby is innocent, has been innocent, and we look forward to defending her in the court of law, and presenting evidence of her innocence to a jury of her peers. We will fight these charges vigorously, and I remain confident that once all the evidence is presented, that she will prevail against these bogus charges—charges that are rooted in personal, political and racial animus five months from her election," Bolden said.

The Associated Press contributed to this report.