Theresa May has vowed to continue as prime minister after agreeing what was dubbed an “Irish Bailout” from the Democratic Unionist Party.

Speaking in Downing Street, after a 20-minute meeting with the Queen, a grim-faced Ms May announced she had the backing of the DUP to provide the “certainty” the country needed.

“Having secured the largest number of votes and the greatest number of seats in the General Election, it is clear that only the Conservative and Unionist Party has the legitimacy and ability to provide that certainty,” she said.

The Conservatives would “work with our friends and allies in the Democratic Unionist Party in particular”, the Prime Minister said.

“Our two parties have enjoyed a strong relationship over many years, and this gives me the confidence to believe that we will be able to work together in the interests of the whole United Kingdom,” she added.

Ms May pledged the Brexit talks would not be derailed, but would start in 10 days’ time, to “deliver on the will of the British people by taking the United Kingdom out of the European Union”.

And she stressed the need for a strong Government to “keep our nation safe and secure”, delivering her promised crackdown on terror following the attacks in Manchester and London.

She would be “cracking down on the ideology of Islamist extremism and all those who support it. And giving the police and the authorities the powers they need to keep our country safe”.

Strikingly, Ms May promised her new government would last “the next five years”, despite losing her majority in a hung parliament.

With the DUP’s support, she is likely to enjoy an effective majority of at least 12, but faces big hurdles to impose her programme and to reassert her battered authority.

Underlining the extraordinary make-up of the new government, Ms May is the first Prime Minister to rely on Irish MPs for their majority since the Liberal Herbert Asquith, way back in 1910.

An aide to former Chancellor George Osborne said: “There are going to be some shiny new motorways, schools and hospitals in Northern Ireland,” – reflecting the price of support.

There will also be questions asked about the DUP’s opposition to same-sex marriage and abortion and its flirtation with denying climate change.

The party’s manifesto also vowed to keep the pensions “triple lock” and winter fuel payments for all pensioners – payouts that the Tories said they would drop.

It was also striking that the Prime Minister referred to the aims of “this Government”, dropping the presidential style of her campaign – reflecting her weak personal position.

Some Conservative MPs believe her position is untenable. Overnight, Mr Osborne, no longer an MP, said: “Personally I don’t see how she can survive for the long term.”

Earlier, the DUP leader herself, Arlene Foster, doubted Ms May could stay in No 10, telling the BBC: “I don't know”, adding: “I think it will be difficult for her to survive.”

Even with the DUP, the Prime Minister may struggle to impose her vision of a hard Brexit without wider support – if Tory Remainers flex their muscles.

Yvette Cooper, the former Labour cabinet minister, called for a cross party commission as the “best chance of a sustainable deal”.