London (CNN) British Prime Minister Theresa May has pledged to form a government that will provide "certainty" and guide the country through Brexit, after voters delivered her party a huge blow at the polls.

May, who visited Buckingham Palace to meet with Queen Elizabeth II Friday, said she would work with Northern Ireland's Democratic Unionist Party, which she described as her "friends and allies"

Promising to move towards a Brexit deal, enabling Britain to exit the European Union, May said the new government would "be able to work together in the interests of the whole United Kingdom."

But Brexit talks -- which are due to start in 10 day's time -- could be delayed and the Prime Minister's personal authority undermined by the shock result.

In a night of high drama, May's party shed seats to Jeremy Corbyn's Labour, which surpassed expectations, leaving the Conservatives short of a working majority by just eight seats.

The result is an embarrassing turn for May who called the election three years earlier than required, to give her side a strong negotiating hand in Brexit negotiations.

One of the lead negotiators for the European Union, Guy Verhofstadt, criticized May on Twitter, writing: "Yet another own goal, after Cameron now May, will make already complex negotiations even more complicated."

Donald Tusk, president of the European Council, added: "We don't when Brexit talks start. We know when they must end."

'Catastrophic' results

The result also prompted criticism of May from within her own ranks as well as from the opposition.

George Osborne, the former finance minister who stepped down at the election, told ITV that the results were "catastrophic" for his party. Anna Soubry, a Conservative MP, said May would have to consider her position.

Conservative MP Nigel Evans told CNN his party shot itself "in the head" with an "irrelevant" manifesto, which was peppered with "arsenic".

Meanwhile, Corbyn said the early results showed May had lost her mandate and called for her to resign.

"People have said they have had quite enough of austerity politics," he said, repeating his campaign promises to push for better funding for health and education.

May looks to the DUP

To pass new legislation, May has turned to the DUP, a small party from Northern Ireland known for pursuing a more socially conservative agenda than the Tories.

Democratic Unionist Party (DUP) leader Arlene Foster says she will speak to Theresa May.

While the party backed Britain's exit from the European Union, it has pushed back in the past against a "hard Brexit".

Speaking Friday, leader Arlene Foster said her party would enter into discussions with the Prime Minister to "bring stability to our nation at this time of great challenge."

Rather than an official coalition, the partnership is likely to be on an issue by issue basis. But May is likely to attract criticism for the decision because of the DUP's stance on same-sex marriage and abortion rights.

Upsets elsewhere

While the election brought a good result for the DUP, there were upsets elsewhere in the UK.

In Scotland, the Scottish National Party dropped a number of seats, as the Conservative Party made some rare gains.

JUST WATCHED Theresa May: What you need to know Replay More Videos ... MUST WATCH Theresa May: What you need to know 01:14

The anti-Brexit Liberal Democrat Party did not make its hoped-for inroads. Former leader Nick Clegg, a former Deputy Prime Minister, lost his Sheffield Hallam seat. Tim Farron, the current leader, retained his seat with only a narrow majority.

Home Secretary Amber Rudd, one of May's closest allies, barely held onto her seat of Hastings and Rye, after a recount put her just over 300 votes ahead of the Labour candidate.

May experienced a gradual slide during the campaign period, in which a wide gap between the Conservatives and Labour narrowed.

Predictions of Conservative success became more modest as the party's campaign faltered following a series of missteps.

The Prime Minister was criticized for making a number of U-turns on social welfare and she came under fire for a controversial proposal on who should pay for the cost of care for the elderly, a policy that became known as the "dementia tax."

Her opponents also took issue with her refusal to take part in a televised debate with other party leaders.

Although called as a Brexit election, the campaign was quickly overshadowed by security as two deadly terror attacks, in Manchester and London, struck.

The attacks only put May under more scrutiny for national security decisions she made during her tenure as Home Secretary, a role she held for six years in the government of her predecessor, David Cameron.

The attacks triggered a heated debate on whether the police are well-enough resourced to deal with terror threats. Police numbers across the UK were cut by 20,000 under May's watch as Home Secretary.