Henriette Reker, who was in stable condition in hospital after being seriously injured in Saturday's assault, has become the most prominent victim of a growing backlash against a huge influx of migrants to Germany.
Standing as an independent, though close to the ruling Christian Democrats (CDU) of Chancellor Angela Merkel, the 58-year-old had been the frontrunner to enter town hall and final results gave her a clear win with 52.6 percent of the vote.
"Victory! We are delighted for Henriette Reker," her campaign team said in a tweet, calling her win "a new start for Cologne".
Trailing in second place was Jochen Ott of the centre-left Social Democrats who secured 32 percent of the vote.
Reker, a trained lawyer, was largely unknown at the national level before she was attacked by a 44-year-old man wielding two knives. Four others were also injured in the stabbing, which happened while Reker was campaigning at a street market.
The crime sparked nationwide outrage with Merkel herself expressing shock at the incident. Police said the attack was a "racist" and "political" act.
Hospital staff said Sunday that, after undergoing emergency surgery, Rekerwas expected to make a full recovery.
For the past five years, Reker has been responsible for running refugee services in Cologne, Germany's fourth-largest city with 980,000 inhabitants.
Tasked with accommodating asylum seekers from Syria and other war zones, she has housed them in sports halls, former commercial spaces and other sites, and has called for their social integration.
The attack against her came as Germany is struggling to cope with a record number of asylum seekers after Merkel said the country would open its doors to Syrian refugees.
Right-wing extremists mobilising'
While many Germans have welcomed the refugees, Merkel's stance has provoked a backlash among her conservative allies and sparked protests among the far-right.
The alleged attacker in Saturday's stabbing -- identified by German media only as Frank S., an unemployed house painter -- has been detained on charges of attempted murder and causing grievous bodily harm.
Police said the suspect, arrested at the scene of the crime, was deemed mentally fit to face justice, had voiced "xenophobic sentiments" and had a history of far-right activism dating to the 1990s.
According to Der Spiegel magazine, the man told police that "foreigners are taking our jobs" and warned that Islamic Sharia law would soon hold sway in Germany.
More than 630,000 people fleeing war and misery in the Middle East and Africa have landed on Europe's shores so far this year.
Most are trying to get to Germany, Europe's economic powerhouse, which is expecting to register up to a million asylum seekers by year's end.
As a result, German security experts are bracing for a rise in unrest, with domestic intelligence chief Hans-Georg Maassen warning in late September of radicalisation of right-wing groups and "a greater willingness to use violence" by all extremist groups.
A recent spike in attacks against asylum homes has added to concerns, while security forces are also keeping a close eye on the resurgent anti-Islamic Pegida movement in eastern Germany, which is to hold a rally on Monday to mark its first anniversary.
The anti-immigration Alternative for Germany party finished in fourth place in the Cologne mayoral race with 4.0 percent of the vote.
Turnout stood at only 40 percent of eligible voters.