LONDON (AFP) - Whoever ends up becoming Britain's new prime minister faces a daunting five years in office, with the negotiations of the country's withdrawal from the European Union topping the list of priorities.
Here are the five main challenges ahead: .
The Brexit negotiations are set to start around June 19, with Britain set to leave the bloc by the end of March 2019.
First up will be the status of EU nationals resident in Britain, and of British citizens living elsewhere in the bloc.
Get The Straits Times
newsletters in your inbox
Both Labour and the Conservatives have said freedom of movement will end when Britain leaves the EU.
If no party wins an overall majority as indicated in Thursday's (June 8) exit poll, there will be little time to form a new government and get a negotiating stance up and running.
Parliament meets on June 13 to swear in MPs.
The state opening of Parliament by Queen Elizabeth II is set for June 19, when she will read out her new government's programme.
Prime Minister Theresa May called the election in order to strengthen her majority in Parliament to go into the Brexit talks with a more secure hand.
2. Terrorism and security
The election was meant to be about Brexit but deadly terror attacks in Manchester, where 22 people were killed in a suicide bombing, and London, when eight were killed in a van and knife rampage, changed the debate.
London was the third Islamist terror attack in three months, also following an attack on Westminster Bridge.
Eighteen terror plots have been foiled since 2013, five of them since March.
Mrs May has come under pressure during the campaign for cutting thousands of police jobs during her time as interior minister.
There were further questions when it emerged some of the attackers were known to security services and apparently escaped the surveillance net.
Tackling the problem of radicalisation among British Muslims and jihadists returning home from Syria will likely be a recurring theme for the incoming government.
Britain ran a budget deficit of 2.6 per cent of gross domestic product in March 2017, down from 9.9 per cent in 2010 after the financial crash.
Its total public debt was £1.7 trillion (S$3 trillion) in April, or 86.0 per cent of gross domestic product. Growth stands at 1.8 per cent and inflation at 2.6 per cent.
Leaving the EU single market would give Britain the opportunity to strike its own trade deals outside the bloc.
The Conservatives pledged to eliminate the deficit and return Britain to profit by the "middle of the next decade", meaning further years of austerity.
Labour pledged to end austerity, hike corporation tax, raise taxes for the top 5 per cent of earners, and eliminate the deficit within five years.
The pound plunged on the exit poll predicting a hung Parliament.
Scotland's governing Nationalists are pushing for a second independence referendum once the terms of the final Brexit deal start to become clear in late 2018 or early 2019.
Backed up by the Greens, the separatists have the Scottish Parliament's support to ask the British government for the formal powers to start the process.
Mrs May fended off their push saying now was not the time, so soon after the 2014 referendum, when 55 per cent backed keeping Scotland in the United Kingdom.
If Labour required the backing of the Scottish Nationalists to form a government, it would likely come at the price of another referendum.
5. Northern Ireland
One of the most delicate parts of the Brexit negotiations will be the place of Northern Ireland within the UK, and relations with the Republic of Ireland, which will be the kingdom's only land border with the EU.
The likelihood of the UK being out of the EU single market, customs union and the EU's free movement area could mean a return of a "hard border" which is fiercely opposed by local residents.
The 1998 accords that maintain the peace in the province after three decades of inter-community bloodshed are delicate and there is concern that Brexit could upset stability.
There is currently no sign that a majority in Northern Ireland, where pro-British Protestants remain the largest group, want to merge into the republic.
But Irish nationalists Sinn Fein have called for a referendum on reunification within the next five years.