Former Maryland Gov. Martin O'Malley (D), front left, endorses Prince George's County Executive Rushern L. Baker III, right, for governor. (Brian Witte/AP)

Maryland’s most recent Democratic governor, Martin O’Malley, endorsed gubernatorial candidate Rushern L. Baker III on Thursday, two days after a Washington Post-University of Maryland poll showed Baker facing a strong challenge for the party nomination.

O’Malley’s support could give the two-term Prince George’s county executive a lift, especially in parts of the Baltimore region, after the poll showed Baker in a tight statewide race with former NAACP president Ben Jealous.

The winner of the crowded June 26 Democratic primary will face popular Republican incumbent Larry Hogan in November.

The Post-U-Md. poll found that 21 percent of likely Democratic voters said they would support Jealous in the primary, while 16 percent favored Baker. The margin is not statistically significant, but it demonstrates the extent to which Jealous, a political newcomer with high-profile progressive endorsements, is threatening Baker, a veteran official backed by much of Maryland’s political establishment.

Nearly 4 in 10 Democratic voters were still undecided, and the other five major candidates were in single digits.

The survey showed a pronounced regional difference, with Jealous well ahead of Baker in the Baltimore area and Baker firmly in the lead in the Washington suburbs. O’Malley was mayor of Baltimore from 1999 to 2007, before winning the governorship and serving two terms, ending in 2015. He ran for president in 2016 but never gained traction.

O’Malley endorsed Baker in Annapolis, at an event where Baker announced a 10-point plan to improve Maryland’s schools. Sixteen current or former elected officials from Baltimore City and Baltimore County also endorsed Baker on Thursday, his campaign said.

“On integrity, on commitment, on vision for the future — all of those things are important,” O’Malley said in an interview. “He has experience in governing and governance, and coalition building. He’s a modern collaborative leader.”

O’Malley had previously expressed support for both Baker and Baltimore attorney James L. Shea in the race and had appeared at fundraisers for both. The poll showed Shea far behind in the primary contest, with just 4 percent support. O’Malley has also worked closely with Jealous and with state Sen. Richard S. Madaleno Jr., another candidate in the crowded field.

A spokeswoman for Shea said that O’Malley had advised them earlier in the day of the decision. She had no comment on O’Malley’s action.

O’Malley, asked what he thought of Jealous, praised him “as an effective advocate for a lot of great issues” but then quickly turned to lauding Baker’s experience in government.

“I know Ben Jealous. We worked together,” O’Malley said. “He was an effective advocate, among others, on repealing the death penalty, and advocacy is important.”

O’Malley then said: “I believe that Rushern Baker has the executive experience to get things done.” He said Baker’s leadership as a legislator in the General Assembly, before he became county executive, was critical to winning a major increase in state school funding.

Baker’s education plan includes increased funding for pre-K programs, language and computer training, teachers’ salaries and school construction. He also called for stronger accountability metrics and improved college access.

Arelis R. Hernández contributed to this report.