Minnesota state Rep. Ilhan Omar scored a convincing victory in the state’s 5th Congressional District on Tuesday night, emerging with a nearly 18-point win over former House Speaker Margaret Anderson Kelliher.

Attorney General Lori Swanson, after leading in polls for the Democratic nomination, lost badly, finishing third behind U.S. Rep. Tim Walz — who secured the nomination — and Erin Murphy, a progressive who finished surprisingly strong.

Rep. Keith Ellison, meanwhile, handily won the nomination to replace Swanson as state attorney general, despite facing last-minute allegations of abuse from his former partner, Karen Monahan, which Ellison denied.

A record number of voters cast ballots in the primary in the 5th District, which includes all of Minneapolis. Out of some 130,000 ballots cast, Omar went home with more than 62,000 to Kelliher’s 39,000, with just a few precincts left to count. By contrast, in 2016, about 44,000 voters participated in the district’s Democratic primary, and 362,000 voted in the general election.

The election was widely viewed as a three-way contest between Omar, Kelliher, and state Sen. Patricia Torres Ray, who came in third with 13 percent. Voter turnout was especially critical in the Minneapolis district; the seat was expected to be uncontested until June 5, when its current occupant, Ellison, jumped into the race for attorney general.

Omar ran a strong ground game, employing the strategies she used in her 2016 state legislative primary that led to a 37 percent increase in voter turnout as compared to the 2014 primary. She was backed in recent weeks by Alexandria Ocasio-Cortez and Rashida Tlaib, insurgent Democratic nominees in New York and Michigan House districts, respectively. Over the weekend, Tlaib, fresh off her primary victory in Michigan’s 13th District, traveled to Minnesota to get out the vote for Omar. Tlaib and Omar are the nominees in solidly Democratic districts, and they are expected to be the first Muslim women in Congress.

The 5th District is the bluest in Minnesota and one of the most progressive in America, and the candidates’ platforms all included the stable of progressive policy priorities like “Medicare for All,” tuition-free college, and abolishing U.S. Immigration and Customs Enforcement.

The race between Omar and Kelliher, Omar told The Intercept in an interview last month, rested on what it means to be a true progressive. “There is a definition of being open to ideas, and being welcoming and inclusive, which is how I would define a liberal point of view. And I think what it means to be progressive is really to think about pushing for a new kind of innovative way of looking at things,” Omar said. “When we are having a conversation between someone like Margaret and myself, we have to look and see who has a history of actually pushing for progressive ideas.”

Omar had the backing of the bulk of the progressive and grassroots groups that weighed in on the race, including MoveOn; Justice Democrats; the statewide and Twin Cities chapters of Our Revolution, the group that was formed from the remnants of the 2016 Bernie Sanders campaign; and CPD Action, an arm of the Center for Popular Democracy.

Because the candidates generally agreed on the issues, they campaigned on their identities and experiences. For Kelliher, it was her 12 years as a state lawmaker, the fact that she was the second woman elected House speaker in the state, and her record of standing up to the state’s Republican governor. Torres Ray, a Colombian immigrant, has been a state senator for the last 12 years, and was the first Latina elected to the Minnesota Senate. Before entering elected office, she was a community organizer and worked in state government, catering to underserved communities. That type of experience is exactly what Congress needs, she argued.

Omar, who made her entree into politics less than two years ago, brought a different type of experience to the race. She emphasized her story as a refugee who made history as the first Somali-American legislator in the United States while arguing that her holistic experience, including as a longtime community organizer and as a millennial with student debt, equips her for the job.

Kelliher appeared to have gone into election day with a significant fundraising advantage. She had raised about $348,000 to Omar’s $246,000 as of July 25, the most recent date for which Federal Election Commission data is available.

Omar will face Republican Jennifer Zielinski in November, an election she is expected to handily win.

Ellison did not endorse any of the candidates running to replace him, but Omar told The Intercept last month that she was inspired by his legacy. “We’re running for a seat that has been held by a true progressive,” she said, “that has been held by someone who really shaped what it means to be a progressive in Washington, and someone who’s affirmed how you can use your seat in Congress to not only push for a progressive agenda, but to make sure you’re continually advancing an opportunity for people to be included in our democracy.”