London (CNN)Londoners will find out Friday if they have elected the first Muslim mayor of any major Western city, after an unusually bitter campaign in which race and religion have proven ugly flashpoints.
London may elect first Muslim mayor Sadiq Khan after ugly campaign
The race between Labour's Sadiq Khan, son of a bus driver, and Conservative candidate Zac Goldsmith, son of a billionaire, has seen the latter accused of peddling "vile race politics" in his campaign against his rival.
Khan, a 45-year-old lawyer and member of Parliament, is the London-born son of Pakistani immigrants, and a practicing Muslim in a city where his co-religionists comprise about 12% of the population.
Elections were held across the United Kingdom on Thursday, for mayoral positions, local council seats, and parliamentary and assembly seats in Scotland and Wales.
The Scottish National Party -- which campaigned for Scotland to leave the UK in 2014 -- won more Scottish Parliament seats than any other party, but failed to secure an outright majority. Labour plunged to third, behind the Conservatives -- a result that would have seemed unimaginable several years ago in the former Labour stronghold.
Labour retained its place as the largest party in Wales — like Scotland, a traditionally left-leaning part of the country— but the pro-Brexit, anti-immigration UK Independence Party picked up its first seats there.
UKIP leader Nigel Farage tweeted that "UKIP now stands up for many traditional Labour voters abandoned by Mr. Corbyn's party" -- a reference to Jeremy Corbyn, who became Labour leader last year.
The results of the London mayoral election are not expected until Friday.
The campaign took a particularly vicious turn when Goldsmith, trailing his rival in polls, penned a controversial column in Britain's Mail on Sunday newspaper on May 1.
The attacks, carried out by Islamist extremists, left 52 people dead.
In the article, Goldsmith accused Khan and the leaders of the Labour Party of having, "whether intentionally or not, repeatedly legitimized those with extremist views."
The piece provoked outrage, and was seen as Islamophobic and unnecessarily divisive in a diverse city whose residents, Muslim and non-Muslim, live under the specter of the ISIS terror attacks that have struck Paris and Brussels in recent months.
The United Kingdom says the current threat level for international terrorism is at severe, meaning an attack is highly likely.
"Tomorrow we must defeat Goldsmith's vile race politics," wrote Maya Goodfellow, a writer for Labour-affiliated blog LabourList, in a comment that was retweeted by Labour MPs.
Even members of Goldsmith's own party were critical.
Baroness Sayeeda Warsi, a Conservative parliamentarian and Muslim, tweeted: "This is not the Zac Goldsmith I know. Are we Conservatives fighting (to) destroy Zac or fighting to win this election?"
The mayoral campaign has been taking place within a wider context of an anti-Semitism scandal gripping Britain's Labour Party, which has seen Labour MPs and councilors suspended after making or posting anti-Jewish remarks.
Critics have accused the left-wing party of being too accommodating of those with anti-Semitic and Islamist views, prompting the party's leader Jeremy Corbyn to set up an independent inquiry into the allegations.
One of those accused of having made anti-Semitic remarks was Ken Livingstone, the last Labour figure to serve as London mayor.
British Prime Minister David Cameron joined the fray, accusing Khan in Parliament of having shared a platform with an alleged ISIS supporter from his constituency on multiple occasions.
Khan tweeted in response to the accusations: "Disappointed PM has joined Zac Goldsmith's divisive, dog-whistling campaign. I've fought extremism all my life."
The candidate admitted in an interview with The Observer newspaper on Saturday that the anti-Semitism fight had probably hurt his prospects, and said his party needed to do more to confront the problem.
"There are too many examples in our party of people having these views, and action does not appear to have been taken quickly enough," he told the newspaper.
Some Labour figures had argued the scandal was the result of a political smear campaign against the party ahead of local elections.
While Khan and Goldsmith are both MPs, the mayoral rivals hail from starkly different backgrounds.
Khan, along with his six brothers and sister, grew up in a three-bedroom public housing apartment. Eventually he studied law, became a university lecturer and the chairman of a civil liberties group, and became a member of Parliament in 2005.
Goldsmith, a former journalist, is the son of a billionaire businessman. He attended the elite Eton College and the Cambridge Centre for Sixth-form Studies, and was editor of The Ecologist magazine for nine years. He was elected to Parliament in 2010.
The winner will replace incumbent Boris Johnson, a colorful, eccentric figure who assumed office in 2008.
Among the issues facing the new leader are affordable housing in a city increasingly drawing the superrich, aging infrastructure and transportation.
A rare Conservative mayor in the Labour-leaning British capital, Johnson is considered one of the country's most popular politicians. He is leading the campaign for Britain to leave to European Union at a referendum on June 23, running up against Cameron, who is in favor of the United Kingdom remaining.