Quentin Palfrey, who won the Democratic Party's convention endorsement in June, announced Tuesday that he is ending his campaign for attorney general and is instead backing Andrea Campbell for the state's top law enforcement post.

Palfrey had been trailing both Campbell and Shannon Liss-Riordan in the attorney general primary contest and a poll last week found that 77 percent of likely voters in this year's primary had never heard of him. Palfrey, who once led the health care division in the attorney general's office and served as general counsel in the U.S. Commerce Department, was the Democratic Party's 2018 lieutenant governor nominee.

Palfrey's exit cements what had been shaping up as a two-woman race for the party's AG nomination. The choice between Campbell, a former Boston City Council president and one-time legal aide to Gov. Deval Patrick, and Liss-Riordan, a high-powered labor attorney who has won against massive corporations, has split Democrats. Palfrey joins Maura Healey, U.S. Sen. Ed Markey, U.S. Rep. Ayanna Pressley and four former AGs in backing Campbell. On Liss-Riordan's side is U.S. Sen. Elizabeth Warren, Boston Mayor Michelle Wu, and former Boston Mayor Kim Janey.

"Andrea's lived experience has shaped her in ways that allow her to connect with families across our Commonwealth. Her devotion to public service is admirable. She will continue the legacy of Maura Healey and be a fighter for justice for all," Palfrey said. He added, "As a former Assistant Attorney General, I am confident that Andrea has the experience to succeed on day one. I know she will be an AG who shows up, listens to our community, and does everything she can to protect and advocate for the people of Massachusetts."

Liss-Riordan campaign manager Jordan Meehan said Tuesday that it was "disappointing that Quentin Palfrey would choose petty insider politics over people."

"His campaign claimed to value putting experience to work for Massachusetts and fighting for progressive policies. It's a shame he's willing to throw that away to curry favor with political elites," Meehan said of the endorsement of Campbell.