Theresa May is set to stay on as Prime Minister under a deal with Northern Ireland's Democratic Unionist Party (DUP) to keep the Tories in power, sources have confirmed to HuffPost UK.
The Ulster party, whose crucial 10 MPs May needs to secure a Commons majority, said that Jeremy Corbyn's record as an "IRA cheerleader" prevented any deal with Labour.
After the shattering loss of seats to Labour in the general election, May was set to head to Buckingham Palace to ask the Queen's permission to form a minority government to cling onto the keys to No.10 Downing Street.
Her 318 Tory MPs, combined with the ten DUP MPs, would allow a wafer-thin majority of just eight Parliamentary seats.
With the markets keen for stability and Brexit talks with the EU looming, senior Tory sources confirmed that talks were underway with the Ulster party.
But despite anger among MPs at the performance of the Conservative election campaign, May was winning support to stay on for several years, rather than being forced out quickly.
One member of the backbench 1922 Committee told HuffPostUK that they wanted her to stay in post as a "caretaker PM" for at least three years, and then hand over to a new leader.
The period would see May stay in charge throughout the Brexit process, which is due to end with the UK quitting the EU in 2019.
Crucially, the DUP – which emerged as Northern Ireland's largest party – has decided that Corbyn's record of working with Sinn Fein makes it impossible for them to work with Labour.
A DUP source told HuffPostUK: "The two parties have worked well together for two years. There's no reason to suppose they won't continue to do so in future.
"But the point made time after time to Labour MPs remains: for as long as you allow yourselves to be led by an IRA cheerleader, you exclude yourselves from entering No 10."
Sinn Fein, which increased its representation to seven MPs, has a long-standing constitutional position that its MPs don't take up their seats in the British Parliament.
When other non-voting MPs are taken into account, parties need 321 MPs for a working Commons majority to get their Budget and other key legislation through Parliament.
If Kensington, the remaining seat to be decided, is taken by Labour as expected, the Tory-DUP alliance would secure 328 votes.
A senior 1922 Committee source told HuffPost UK: "I think we need to aim for a five-year Parliament with a suitable amount of time for a new leader to bed in before the next election.
The veteran Tory MP added: "A new leader with the baton handed over nearer the end of the five years than the beginning.
"It's been a very long night but from my perspective the small mercy is that Corbyn is not No.10."
However, other Tory MPs were hoping for a shorter 'caretaker' period for May, possibly only of a few months, if Brexit talks - due to end in March 2019 - could be extended.
Corbyn has frequently denied claims thrown at him in the election campaign that he was a "friend of the IRA". He claimed he fought for peace as a backbencher.
Newly-returned DUP MP for East Belfast Gavin Robinson said any deal would be on the basis of a "confidence and supply" arrangement - not a formal coalition but vote-by-vote basis for Commons bills.
"We have essentially got the result we were campaigning for two years ago," he said.
"It didn't materialise then but we campaigned on the basis of a hung parliament two years ago.
"I think that puts us in a fantastic position to deliver for Northern Ireland."