Andrea Campbell made the jump from a little-known Boston city councilor to the Democratic nominee for attorney general in just six years.

Campbell was a first-time candidate in 2015 when she unseated an incumbent councilor, and went on, in her second term, to become the Boston City Council’s first Black woman president. On Tuesday night, she celebrated another milestone as she became the first Black woman nominated as a party’s candidate for attorney general in Massachusetts.

Addressing supporters after her primary win over labor lawyer Shannon Liss-Riordan, Campbell said the history of the moment wasn’t lost on her. She also referenced her own personal history from the podium set up at ReelHouse Marina Bay in Quincy, talking about growing up in public housing with incarcerated family members and parents who died when she was young.

Campbell said the run was personal to her, but that she did it for people across Massachusetts who don’t feel that government has heard their concerns.

“We crisscrossed the state from Boston to Worcester, to Springfield, Pittsfield, communities in between and around, including the islands,” she said. “It didn’t matter the travel time or how many people were in the room. It mattered that we were talking to real people and real residents about what they wanted from their next attorney general.”

Campbell ran with the support of current attorney general and Democratic nominee for governor Maura Healey, who campaigned with her at several stops over Labor Day weekend. Campbell recognized Healey and her team in her victory speech, thanking her for her “political courage.”

Shortly after Healey spoke at her own election-night gathering in Dorchester, several of the guests — including high-profile Democrats like state Senate President Karen Spilka — made their way to Campbell’s party.

Campbell arrived around 10:30 p.m. to cheers, applause and one person banging a pot with a spoon. She entered the room to a Mahalia Jackson song she said she chose because she played the same singer at her twin brother Andre’s funeral. Andre Campbell died in state custody while awaiting trial, and the candidate said he gave her the courage to keep moving forward and to turn her pain into purpose.

Giving her concession speech at Boston’s Fairmont Copley Plaza Hotel, Liss-Riordan said she’d be proud to stand with Campbell in November.

“I got into this race because I believed I was the best person to fight for the people of Massachusetts,” Liss-Riordan said. “My career has been defined by taking on the biggest challenges and delivering big results for everyday people. Throughout my career, I have proven that I am not afraid of anyone or anything. As one of the relatively few women in my field, I'm proud to have made national headlines and paved new legal ground in the fight for justice.”

Liss-Riordan spent $9.3 million of her own money on her campaign, and the bulk of that was reported in August, as polls showed her closing in on Campbell’s early lead.

Naomi Yu, a 15-year-old from Newton who worked on Liss-Riordan’s campaign, said coming from an immigrant family, Liss-Riordan’s work as a labor lawyer, such as recovering lost wages for working class people, meant a lot to her. She was a bit tearful but positive after her candidate conceded.

“I mean, even as she [Liss-Riordan] said, even if this is not the outcome that we were hoping for, she’s still such an inspiration to young women like me who want to make a difference,” Yu said. “And it doesn’t take away in the slightest bit all that she’s done fighting for workers rights, as she said, fighting for access to reproductive health care and all of those things that are just going to be so important for people, for the future generations.”

The race divided some of the state’s political power players. Sen. Ed Markey and Rep. Ayanna Pressley were among Campbell’s backers, while Sen. Elizabeth Warren, Boston Mayor Michelle Wu and former acting Boston Mayor Kim Janey with Liss-Riordan. A third candidate in the AG's race, Quentin Palfrey, dropped out last week and endorsed Campbell.

Campbell ran for Boston mayor in the 2021 race where Wu would ultimately claim victory.

State Rep. Tackey Chan, a Quincy Democrat who endorsed Campbell, said having a base in Boston that had voted for her before was a point in Campbell’s favor. Chan said Campbell’s personal story and authenticity resonate with voters.

“She is what you have in front of you,” he said. “I can respect that, because far too often people want to cater to voters by being something else.”

Another supporter, Carla Monteiro, said she’d been following Campbell since her time on the City Council and believes her lived experience and professional experience set her apart. Campbell has served as a legal services attorney and as deputy legal counsel to Gov. Deval Patrick.

“The way that she views things is from a holistic lens, and I’m a social worker, so I think that’s very important,” said Monteiro, a former Boston City Council candidate.

Campbell is set to face Republican Jay McMahon in the Nov. 8 election, where she’ll look to continue Democrats’ decades-long hold on the office. The last Republican attorney general in Massachusetts was Elliot Richardson, who stepped down in 1969 to join President Richard Nixon’s cabinet.