Just under a month after she declared her candidacy for governor, Valerie Ervin is exiting the Maryland gubernatorial race, and backing Prince George's County Executive Rushern Baker.

Ervin and her running mate, former Baltimore County school board member Marisol Johnson, will announce their support for Baker — as well as his running mate, state prosecutor Elizabeth Embry —  at a campaign event Wednesday in Langley Park, the Baker campaign said in a press release Tuesday. The event comes the day before early voting begins for Maryland's June 26 primary election.

Ervin, a former Montgomery County Council member and school board member, called Baker and Embry "the right team to fight for the people of Maryland" that has "unmatched experience and passion," The Washington Post reported. When Ervin spoke at the University of Maryland in March, she voiced support for free community college, marijuana legalization and universal health care.

Ervin initially entered the race as the running mate for Baltimore County Executive Kevin Kamenetz. Kamenetz died of cardiac arrest on May 10; a week later, Ervin announced she would be running in his place.

Ervin's campaign ran into trouble from the start. State law forbade her from using the campaign funds Kamenetz had raised — over $2 million, as of January. And on June 4, a judge ruled in favor of election officials that the primary would proceed with Ervin's name still listed as Kamenetz's lieutenant governor candidate. Ervin declined to appeal the ruling, the Baltimore Sun reported.

Her departure from the race leaves six major contenders — Baker, former NAACP President Ben Jealous, state Sen. Rich Madaleno (D-Montgomery), attorney Jim Shea, former Michelle Obama policy advisor Krish Vignarajah and tech entrepreneur Alec Ross. The winner of the Democratic primary will face incumbent Republican Gov. Larry Hogan in November's general election. The governor has a high approval rating, in a state where registered Democrats outnumber Republicans two-to-one.

Despite gaining some name recognition from the lawsuit and Kamenetz's untimely passing, Ervin lagged behind Baker and Jealous in recent polls. Baker was tied with Jealous with 16 percent support, and Ervin landed in a distant third place with five percent support, a recent University of Baltimore poll showed.

With Ervin's backing, Baker gains another key endorsement — just days after former Maryland Gov. Martin O'Malley backed the county executive on June 7.