Boston City Councilor Ayanna Pressley, in a historic upset that is sure to send ripples across the Democratic Party, defeated incumbent Rep. Michael Capuano in Tuesday’s contest for control of Massachusetts’ 7th congressional district, positioning herself to become the first African-American woman to join the state’s Washington delegation.

Just after 9 p.m., Caupano publicly conceded the race to Pressley saying, "I'm sorry it didn't work out, but this is life. This is okay." Capuano congratulated Pressley on her win, telling supporters she'll be a good representative.

In the end, Pressley won around 59 percent of the vote to Capuano's 41 percent — an 18 point gap not predicted by public polls, which repeatedly found Capuano ahead.

Pressley, a Boston city councilor-at-large with Chicago roots, launched her campaign earlier this year against Capuano around the phrase “Change Can’t Wait" — though there were few policy differences between her and her opponent. On the campaign trail, Pressley touted the need for "bold" and "activist" leadership in Congress and argued she would be a better representative because she understands the needs facing the state's only majority-minority district.

Taking her position at the podium to deliver her victory speech, Pressley let out a deep sigh before addressing a cheering crowd of supporters at IBEW Local 103 in Dorchester.

“Well, it seems like change is on the way,” said Pressley.

In her remarks, Pressley thanked Capuano for his decades of service to the district, calling him “unapologetically himself.” Pressley also acknowledged that the decision to challenge Capuano wasn’t easy, noting she knew it would be an uphill battle.

“I knew we would be essentially alone,” Pressley said. “I knew I would be demonized as entitled and what no woman could ever be: ambitious.”

Pressley also used the moment to attack President Donald Trump, calling him a “racist, misogynistic and truly empathy-bankrupt man.”

Capuano, 66, the former mayor of Somerville who was first elected to the House in 1999, faced his first serious challenger in Pressley, 44, who was among a crop of younger insurgent candidates taking on veteran incumbents this primary season. Throughout the campaign, Capuano often touted his ability to bring federal funds back to the district and was poised to play a key leadership role if Democrats won the house in November.

Supporters at Capuano headquarters listened — silent and stunned — as the 10-term congressman took the stage, flanked by six American flags and conceded in the upset of the night.

“Clearly the district wanted a lot of change,” he said, pointing to the loss of long-time state Rep. Byron Rushing and others.

He left the stage and turned away from press interviews, electing instead to shake the hands of the shocked throng before exiting the ballroom.

The 7th congressional district stretches through parts of Boston, Cambridge and Milton and includes Somerville, Chelsea and Randolph.

Since no Republican is on the ballot for this race in November, Pressley will almost certainly represent the 7th District in 2019.

This article has been updated.