State Sen. Brian E. Frosh, seeking the Democratic nomination for attorney general, participates in a debate at University of Maryland's Van Munching Hall in College Park, Md., on May 19. (Nikki Kahn/The Washington Post)

Maryland Gov. Martin O’Malley will endorse state Sen. Brian E. Frosh’s bid for the Democratic nomination for attorney general at a rally Thursday in Prince George’s County, officials said.

The endorsement comes as Frosh (Montgomery) prepares to face his primary rivals, Dels. Jon S. Cardin (Baltimore County) and Aisha N. Braveboy (Prince George’s), next week in their second debate.

Frosh will add O’Malley’s support to a long list of endorsements from prominent state leaders, including former governors and attorneys general. He has secured thousands of dollars in contributions, dwarfing the fundraising efforts of his two competitors for the nomination.

After early polls suggested that Cardin might have an upper hand, Frosh launched a grueling campaign to raise his profile among state voters, traveling from county to county and emphasizing Cardin’s absences during the past legislative session.

In the first debate, Frosh went on the offensive and questioned the three-term delegate’s judgment for using a Baltimore City police helicopter and boat for a staged marriage proposal in 2009 at the Inner Harbor.

Cardin, who issued an apology soon after the proposal, said in the debate that his actions were a mistake and that he has learned from the experience. He also said family health issues kept him from having perfect attendance at committee votes.

While Frosh has maintained his overall fundraising lead, Cardin, the nephew of U.S. Sen. Benjamin L. Cardin (D-Md.), raised more money during the last reporting session, according to the Maryland State Board of Elections.

Cardin’s campaign platform has focused on the future of criminal activity, specifically cybercrime, identity theft, cyberbullying and other scams perpetrated online.

Braveboy, a Prince George’s County real estate lawyer, has struggled to generate the same support, name recognition and campaign financing as Frosh and Cardin.

She is popular in her home county and has been endorsed by unions, but the delegate was criticized for the stance she took in Annapolis during the debate about legalizing same-sex marriage. She pushed for a ballot referendum.

Frosh is running on his legislative record and experience as a lawyer fighting for stricter gun laws and marriage equality and against foreclosure scams.

Last week, Frosh aired his first television commercials touting his recent endorsement by The Washington Post editorial board.

The rally is scheduled for 3 p.m. at Martin’s Crosswinds in Greenbelt. The next scheduled debate is Monday.