The PM had hoped to increase the Conservatives' majority in Parliament so they had a stronger mandate to deliver Brexit.
But now the country looks set for a hung parliament, after her party ended the night with fewer seats than before.
The result has sent shockwaves around Europe and beyond.
EU Budget Commissioner Gunther Oettinger has questioned whether talks on the UK's departure from the EU can now start on 19 June as planned.
"No government - no negotiations," he told German broadcaster Deutschlandfunk.
Sweden's former Prime Minister Carl Bildt, who now chairs the European Council on Foreign Relations think-tank, called the outcome "messy".
"One mess risks following another. Price to be paid for lack of true leadership," he tweeted.
'Another own goal'
Brexit negotiator Guy Verhofstadt, who is president of the Alliance of Liberals & Democrats for Europe in the European Parliament, had caustic words for Mrs May.
"Yet another own goal, after Cameron now May, will make already complex negotiations even more complicated," he tweeted.
Michel Barnier, the EU's chief negotiator for Brexit, had a more conciliatory message. "#Brexit negotiations should start when UK is ready; timetable and EU positions are clear. Let's put our minds together on striking a deal," he said.
Mr Barnier also retweeted European Council President Donald Tusk, who alluded to the March 2019 deadline for Brexit talks.
"We don't know when Brexit talks start. We know when they must end. Do your best to avoid a "no deal" as result of "no negotiations", he wrote.
Former Finnish Prime Minister Alexander Stubb and senior German MP Stephan Meyer both said Britain should be given time to form a stable government before Brexit negotiations start.
"It means instability for Britain," Mr Meyer told German radio. "Officially Theresa May is still the partner in Brexit negotiations, but the political reality is different after this disastrous defeat. I can't imagine that May will be able to remain prime minister."
The European Union's foreign policy chief, Federica Mogherini, said it was uncertain when Britain would have a clear Brexit strategy.
"One year after their referendum, we still don't know the British position in the negotiations on Brexit and it seems difficult to predict when we will, because democracy often requires time," she said.
Leaving politicians for the press arena, German tabloid Bild ran the headline "Election blow for Theresa May," while Frankfurter Allgemeine Zeitung and Die Welt chose "May-Day".
"The voters of the United Kingdom are insecure, angry and upset," observed Frankfurter Allgemeine, calling it: "A vote against a hard Brexit."
Elsewhere in Europe, Italian daily La Repubblica declared: "May's gamble fails, loses her majority", and noted that voter turnout was the highest for 20 years at 69%.
France's Le Monde observed that the pound has fallen against the dollar, and that the British economy had already seen the lowest growth of any G7 country during the first quarter of the year.
Looking east from London, the Chinese press offered largely factual reports, with little comment except to say the result would have a "huge" impact on Brexit discussions.
In Hong Kong, independent outlets said the Tories had made a "grave miscalculation".
Shi Zhiqin, a professor from Tsinghua University in Beijing, said China may no longer see the need to keep Britain as a strong ally in the EU.
"But I think Britain's main concern is to keep China as a trade partner after it lost the EU market," he told the South China Morning Post.
A correspondent for Qatar-funded Al-Jazeera TV, which ran a special segment on the polls, said the Labour party had led a "fierce campaign that the Conservative Party did not expect".
The results were covered prominently on some Lebanese newspaper websites, with the front page of left-wing Al-Akhbar newspaper reading: "Britain: Corbyn brings down the hopes of the Conservatives."
In India, newspapers are taking an interest in Preet Gill, who has become the UK's first Sikh woman MP, and Tanmanjeet Singh Dhesi, the first turban-wearing Sikh winner.
Indian headlines also concluded that the result was a setback for Theresa May, with the Hindustan Times calling it a "stunning blow" for the prime minister.
Congratulations to Corbyn
Labour boosted its number of seats by 29 overnight, exciting Corbyn supporters abroad.
US Senator Bernie Sanders, the former Democratic presidential candidate, told the Washington Post he was thrilled.
"I am delighted to see Labour do so well. All over the world people are rising up against austerity and massive levels of income and wealth inequality.
"People in the UK, the US and elsewhere want governments that represent all the people, not just the 1%. I congratulate Jeremy Corbyn for running a very positive and effective campaign."
Bill Shorten, leader of the Australian Labor Party, made similar observations, telling reporters:
"One of the things which my counterpart, the Labour leader in the United Kingdom, did is he campaigned and his slogan was: 'for the many, not the few'.
"I think Mr Turnbull [Australia's prime minister] would be well advised to look at the popularity of that message."
Former Belgian Prime Minister Elio Di Rupo also tweeted his approval, writing: "Congratulations to @jeremycorbyn for its positive campaign and to the Labour Party for its good results #UKElection2017"
Martin Schulz, former president of the European Parliament, congratulated Mr Corbyn, saying they had spoken by phone and agreed to meet soon.
In Russia, state-owned news agency RIA Novosti is claiming the Conservatives will not forgive Theresa May for the result, and predicts a new prime minister.