BOSTON (AP) — The Democratic race for Massachusetts attorney general dwindled to just two candidates Tuesday when Quentin Palfrey officially suspended his campaign and endorsed Andrea Campbell, who will face off against fellow Democrat Shannon Liss-Riordan in next Tuesday’s primary election.

Palfrey, a former assistant attorney general and 2018 Democratic candidate for lieutenant governor, said Campbell — a former Boston city councilor who ran unsuccessfully for mayor last year — will continue the legacy of Attorney General Maura Healey and be “a fighter for justice for all.”

Healey is running for governor in the Democratic primary, leaving an open race for attorney general. Her only opponent dropped out of the campaign, virtually assuring her the nomination. Healey has endorsed Campbell, as have four prior state attorneys general, U.S. Sen. Edward Markey and U.S. Rep. Ayanna Pressley.

“I am confident that Andrea has the experience to succeed on day one,” Palfrey said in a statement. “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.”

If elected in November, Campbell would be the first Black woman to hold the office in Massachusetts.

Liss-Riordan, a workers’ rights attorney, has the endorsement of Sen. Elizabeth Warren, Boston Mayor Michelle Wu and former acting Boston Mayor Kim Janey.

Whoever wins will face off against Republican Jay McMahon, a trial attorney, in the November election.