MINNEAPOLIS (AP) — Challenger Jacob Frey won the Minneapolis mayor's race Wednesday, defeating incumbent Betsy Hodges in a crowded race to lead Minnesota's largest and most liberal city that was rocked by two fatal police shootings.

Frey, 36, a one-term City Council member, emerged from more than a dozen candidates to challenge Hodges, and got more than 50 percent of the vote to be declared the winner. He takes office in January.

"We're going to get right to work," Frey told the Star Tribune. "We are a divided city in many respects, and the first item of business is to mend wounds, unite around shared goals and create a collective recognition that a deviation in strategy doesn't mean a difference in morals."

Frey led in the first round of voting Tuesday. Then on Wednesday the city began redistributing second- and third-choice preferences from losing candidates under its ranked-choice system for municipal elections.

Hodges, 48, a former City Council member, was seeking a second term as mayor. Her first term included steering the city through two high-profile shootings by police officers. One was the fatal July shooting of Justine Ruszczyk Damond, an Australian native who called 911 to report a possible sexual assault near her house and was shot when she approached the officers' squad car in an alley. Hodges forced out police Chief Janee Harteau amid sharp criticism that the officers had not turned on their body cameras.

The other shooting came during a 2015 scuffle between a black man and two white officers on the city's north side. Jamar Clark, 24, was killed.

Clark's death sparked violent confrontations between citizens and police, as well as a prolonged encampment outside the nearby police precinct. Hennepin County Attorney Mike Freeman declined to charge the officers, saying that evidence showed Clark had gotten his hand on an officer's gun before he was shot. More protests came after Freeman's decision.

Much of the mayoral campaign focused on police-community relations.

Hodges, in a statement, said she spoke to Frey and congratulated him on his victory.

"Together, Minneapolis, we've made real change, and lasting change in our city," said Hodges, who called serving as mayor "the greatest honor of my life."