In the span of a decade, Boston went from electing its first black woman to the city council, to a majority-female and majority-minority council following Tuesday’s historic election.

Tuesday marked the first time in Boston’s history with a majority of councilors who were women and people of color. Ayanna Pressley was the first black woman elected to the council in 2009, one of two women on the council.

Julia Mejia, who came in fourth, is the first Afro-Latina immigrant to win an at-large seat. Mejia celebrated the council’s diversity as she thanked her supporters.

“I am humbled to be your first Afro-Latina immigrant woman councilwoman,” Mejia tweeted Tuesday night. “This campaign was never about me though, it was always about bringing power to the people. To give voices to those who felt left out. #ItsTime, and our work starts tomorrow.”

Mejia declared victory while margins between her and her closest contender, Alejandra Nicole St. Guillen, was a matter of triple digits. As the night progressed, the margin narrowed to 10 votes and St. Guillen has called for a recount.

“We are so proud of the campaign we ran, and in order to fight for a better Boston for all, every vote needs to be counted, and we are requesting a recount,” she said in a statement.

Michelle Wu, Annissa Essaibi George and Michael Flaherty were re-elected to their at-large seats Tuesday.

The two female incumbents, Mejia and the women who hold seats in Districts 1, 4, 7, 8 and 9, bring the total number of women serving on the council to eight out of 13.

Let’s cut right to it: women made history tonight - For the first time, we’ll have a council that is majority women, and the most diverse in history!



Thank you to the residents of Boston for recognizing the incredible leadership of women. — Andrea J. Campbell (@CampbellforD4) November 6, 2019

Ricardo Arroyo became the first person of color to win the District 5 city council seat. His father, Felix D. Arroyo, was the first Latino to serve on the council. His brother, Felix G. Arroyo, also served on the council.

But the real upset came in the at-large race as Mejia was neck-and-neck with St. Guillen. The former director of the city’s Office for Immigrant Advancement, St. Guillen had endorsements from Wu and Mayor Marty Walsh.

Julia Mejia, 49, of Dorchester, is the founder and director of the Collaborative Parent Leadership Network.

“I want to make City Hall open and accountable for all Boston residents to have a fair shot and a voice in the future of our city, by calling for structural changes to our city government’s policy-making processes,” she told the Boston Globe.

With all precincts reporting, Mejia eked past St. Guillen with 22,464 votes compared to St. Guillen’s 22,454 — a difference of 10 votes.

St. Guillen’s conceded during her watch party Tuesday night, telling supporters she believed she was 200 votes behind.

“It does look like we didn’t make it,” St. Guillen told supporters Tuesday night.

Looks like @juliaforboston’s got it. @astguillen says she is 200 votes behind and called Mejia. Won’t go for a recount. “I don’t feel we left anything on the field,” St. Guillen says. #mapoli #bospoli pic.twitter.com/St1ey4Aaih — Stephanie Murray (@stephanie_murr) November 6, 2019

Wu came in first with 41,616 of the at-large candidates with one-fourth of the vote. Essaibi George came in second with 34,054, followed by Flaherty with 33,242.

Mejia and St. Guillen vied for fourth place, in hopes of claiming Althea Garrison’s seat.

Garrison, a perennial candidate, was appointed in January after Ayanna Pressley left the council to began her first term in Congress. But she failed to defend her spot Tuesday.

Erin J. Murphy, a former Boston Public Schools teacher, got 16,843 votes.

Garrison followed with 16,161 votes.

David Halbert, the former deputy director of community affairs for the Middlesex County Sherrif’s Office, came in eighth with 13,201 votes.

There were 885 write-in candidates for the at-large seats. In total, the city recorded at least 66,884 votes.

Lydia Edwards, running unopposed, was re-elected to the District 1 seat. Edward M. Flynn ran unopposed and again won the District 2 seat. Frank Baker, also unopposed, was re-elected to the District 3 seat.

In District 4, incumbent Andrea Joy Campbell, president of the Boston City Council, pulled ahead of her challenger, Jeff Durham. Campbell got 4,557 votes compared to Durham’s 636 votes.

In District 5, Arroyo captured 5,325 votes compared to Maria Esdale Farrell’s 4,398 votes. A Puerto Rican, Arroyo made history by becoming the district’s first non-white representative.

In District 7, incumbent Kim Janey garnered at least 3,847 votes, while Roy Owens Sr. got at least 1,263 votes.

In District 8, Priscilla Kenzie Bok got 3,659 votes, while Jennifer Ann Nassour got 1,539 votes.

Liz A. Breadon won the District 9 seat with 3,883 votes compared to Craig R. Cashman’s 2,724 votes.

Cashman came under scrutiny after Chinese Progressive Political Action, who endorsed Breadon, tweeted pictures of fliers with the CPPA logo that promote Cashman.