Theresa May has revealed she shed a "little tear" when she learned the result of the election exit poll suggesting she would lose her majority.
The prime minister said her husband Philip told her the news - and it came as a "complete shock".
"It took a few minutes for it to sink in," she told BBC Radio 5 Live's Emma Barnett, because "we didn't see that result coming".
"My husband gave me a hug," she added, and she cried a "little tear".
The prime minister said she did not watch the exit poll herself, as "I have a little bit of superstition about things like that".
She knew her campaign had not been "perfect", she added, but all the indications she had had were that she would increase her Commons majority.
Mrs May called 8 June's general election to tighten her grip on power and strengthen her hand in Brexit talks by increasing the number of Conservative MPs in the Commons.
But although she started more than 20 points ahead of Labour in the opinion polls she lost most of that lead as well as 22 seats, wiping out the 17 seat majority she had inherited from predecessor David Cameron.
The ITV/Sky/BBC exit poll, which was carried out at polling stations across the UK, was met with surprise and scepticism by MPs from all parties when it was announced as voting ended - the widespread assumption had still been that the Conservatives would at least keep their majority.
But as the night unfolded its prediction that the Conservatives would be the largest party, but without an overall majority, turned out to be accurate.
Talking for the first time about her reaction to the result, she said it took a "few minutes" for it to sink in but she then got on the phone to Conservative campaign headquarters to "find out what had happened".
She said it was "devastating" to watch people she had worked with for years lose their seats but added: "I didn't consider stepping down because I felt there was a responsibility to ensure that the country still had a government."
Asked about the criticism she faced for failing to acknowledge her lost majority in a speech in Downing Street the following day, Mrs May said: "At that point in time I felt what was important was giving people the confidence of knowing there was going to be a government."
She said she did not regret calling the election because "I think it was the right thing to do at the time".
Analysis by BBC political correspondent Alex Forsyth
In her bid to promote strength and stability during the election, Theresa May was often accused of being repetitive and robotic.
Today she showed a more human side.
Mrs May's candid interview may come too late for those who weren't persuaded by her personality during the election, but no doubt her team will hope it helps garner public support for her still precarious premiership.
But she wished she had put across a more positive message during the campaign and, in particular, addressed the concerns of young people, who are believed to have voted in large numbers for Labour.
The "clear message" that came through from young people was that they feared they could not get on the "property ladder", she told Emma Barnett.
"Looking back on the campaign, I realise now and regret that we were not making more of that," she said.
She insisted her government had the "humility" to "listen to the message we got from people at the election".
One of those messages, she said, was that people wanted to see a "greater consensus" in Parliament, which was why she had appealed for support from Labour on Brexit and other policies.
On Labour leader Jeremy Corbyn - who was the target of Conservative attacks on his character and judgement during the campaign - she praised the way he had reacted to the terror attack at Finsbury Park in his constituency.
"I saw a Jeremy Corbyn there who was a good constituency MP, working with those people," she said.