Minneapolis Mayor Jacob Frey has been elected to a second term after a hotly contested race that was too tight to call on election night.

Frey was declared the winner of Wednesday morning after city officials allocated the second and third choices of voters as to who they would choose if their desired candidate was eliminated leaving Fry with 49.1% of the votes compared to the second-place vote-getter, Kate Knuth, who had 38.2%.

GOP LAWMAKERS URGE DC HEALTH DEPT. TO WALK BACK THREAT TO REVOKE MEDICAL LICENSES OF FIREFIGHTERS, EMS

Seventeen candidates ran in the race, including many who took issue with the way Frey has handled changes to the police department since one of its officers killed George Floyd last year. Frey, a Democrat, risked his political future and drew the ire of the city’s most liberal voices by opposing a ballot question asking voters to eliminate the police department.

The measure, which asked voters if they favored amending the city's charter to replace the Minneapolis Police Department with a Department of Public Safety, failed on Tuesday night. The initiative would have removed language from the charter related to the agency, including minimum funding requirements, and would have divided control of public safety between the mayor and city council. 

VIRGINIA LT GOV-ELECT WINSOME SEARS SLAMS JEMELE HILL AFTER SPORTS WRITER BLAMES 'WHITE SUPREMACY' FOR HER WIN

The question failed 57% to 44%, according to the results released by the Minnesota Secretary of State's office with 133 of 136 precincts reporting. It needed 51% of voter approval to pass. 

Frey was the face of Minneapolis when George Floyd was killed while in police custody in May 2020 and presided over the rioting that marred ensuing protests and led to the burning of a police precinct after Frey ordered officers to abandon it. 

CLICK HERE FOR THE FOX NEWS APP

During the worst of the Minneapolis unrest, conservatives accused Frey of failing to stem the riots and crack down on soaring crime and gun violence. Meanwhile, the left criticized him for not doing enough to overhaul the police department.

Fox News' Louis Casiano and Associated Press contributed to this report