Nick Timothy and Fiona Hill, Theresa May’s closest advisers, have resigned in the wake of the Conservatives’ failure to win the general election.
The PM had been warned she faced a leadership challenge on Monday unless she sacked the pair, the BBC understands.
Mr Timothy said he accepted responsibility for his role in the Tory manifesto, criticised by many MPs.
He said he regretted not including a pledge to cap total social care costs.
The BBC’s assistant political editor Norman Smith said the pair’s departure bought the PM some “breathing space” following 24 hours of recriminations after the Conservatives lost their overall majority.
Mrs May has said she intends to stay as prime minister and is seeking support for the Democratic Unionists to form a government. Chief Whip Gavin Williamson is in Belfast to begin formal talks on a deal.
- Live updates and rolling coverage
- No 10 was ‘toxic’ says former May aide
- Who are the DUP?
- Can a Conservative and DUP pact work?
- Q&A: What is a hung parliament?
Mr Timothy and Ms Hill both stepped down amid mounting pressure on Mrs May to overhaul the way No 10 worked and broaden her circle of advisers.
Announcing his resignation on the Conservative Home website, Mr Timothy urged Tory MPs to “get behind” Mrs May but said nothing should be allowed to get in the way of the process of forming a government and beginning Brexit talks.
He said the Conservatives’ failure to win was down to an “unexpected surge” of support for Labour and he conceded his party had failed to communicate a sufficiently “positive” message to voters and address their “frustrations” over years of austerity and inter-generational divisions, including over Brexit.
While defending the party’s manifesto, he added: “I take responsibility for my part in this election campaign, which was the oversight of our policy programme.
“In particular, I regret the decision not to include in the manifesto a ceiling as well as a floor in our proposal to help meet the increasing cost of social care.”
Labour has urged Mrs May to “make way” for it to form a government and she also faces criticism over the DUP deal.
The leader of the Scottish Conservatives, Ruth Davidson, tweeted a link to a speech she had made about same-sex marriage – something the DUP opposes.
A number of high-profile government figures have already confirmed they are keeping their jobs in the wake of an election that saw the Tories lose 13 seats.
Philip Hammond will stay as chancellor, Boris Johnson will remain as foreign secretary and Amber Rudd – narrowly re-elected as an MP after a recount – will continue as home secretary.
David Davis will also stay on as Brexit secretary and Sir Michael Fallon will keep his role as defence secretary.
There could be changes elsewhere in the cabinet while nine middle-ranking and junior ministers, including Ben Gummer and Jane Ellison, lost their seats at the general election and will need to be replaced.
But BBC assistant political editor Norman Smith said the prime minister had been facing calls from MPs to remove her joint chiefs of staff, who have been blamed for the failure to win the election – and adopt a “very different approach and style of leadership”.
Mrs May’s director of communications until the election was announced, Katie Perrior, called the campaign “pretty dysfunctional”, telling the BBC she “needed to broaden her circle of advisers and have a few grey hairs in there who been around a bit and could say ‘don’t do that'”.
Norman Smith said he understood that senior Conservatives had warned the PM they would instigate a leadership contest at a meeting of Conservative backbenchers early next week if the pair did not leave, and were confident they could get the required 48 signatures to trigger a contest.
The calls to change her style of leadership, her advisers and the way she runs Downing Street come after criticism mounted over the decision to call a snap election and the way the campaign was run.
Mrs May announced her intention to work with the DUP to form a government on Friday, just hours after an election that left the UK with a hung parliament for the second time in seven years.
Speaking on the steps of No 10 after an audience with the Queen, the prime minister said the parties had a “strong relationship” and that she intended to form a government which could “provide certainty and lead Britain forward at this critical time for our country”.
DUP will use leverage on May deal
Analysis by political correspondent Gary O’Donoghue
The clock is ticking for Theresa May. She needs to conclude a deal with the DUP in the next week or so ahead of the Queen’s Speech, which will set out the new government’s agenda.
That takes place on Monday 19 June – the same day Brexit negotiations are due to start.
The DUP and its 10 MPs are in a very strong position. It’s all their Christmases rolled into one and they will make sure they leverage as much as they can from their advantage.
Money for Northern Ireland will undoubtedly be part of their demands, and Mrs May will expect that. But trickier will be any demands they have about the implementation of Brexit in Northern Ireland – in particular the DUP’s determination to maintain a soft border with the south.
Another potential problem is the planned restart of negotiations for power-sharing in the province.
Typically the British government tries to act as an honest broker between Republicans and Unionists. But if Mrs May is doing a deal with the DUP, that could make it harder to reach an agreement with Sinn Fein.
DUP leader Arlene Foster confirmed she had spoken to Mrs May and that they would speak further to “explore how it may be possible to bring stability to this nation at this time of great challenge”.
Mrs May’s decision to seek a deal with the DUP has prompted concerns from some Tories.
Charles Tannock, a Conservative member of the European Parliament, said the DUP was a “hardline, populist, protectionist” party and a “poor fit” as a partner for the Conservatives.
Northern Ireland is the only part of the UK where same-sex marriage is not legal.
Ms Davidson, who is gay, plans to marry her partner in the near future and said she had been “straightforward” with Mrs May about her concerns.
“I told her that there were a number of things that count to me more than the party,” she told the BBC. “One of them is country, one of the others is LGBTI rights.
“I asked for a categoric assurance that if any deal or scoping deal was done with the DUP, there would be absolutely no rescission of LGBTI rights in the rest of the UK, in Great Britain, and that we would use any influence that we had to advance LGBTI rights in Northern Ireland.”
- What does result mean for Brexit?
- Merkel: ‘EU ready to start Brexit talks’
- Election winners and losers
By winning 12 additional seats in Scotland, Ruth Davidson played a significant part in helping Theresa May to stay in Downing Street, BBC Scotland editor Sarah Smith says.
Ms Davidson clearly plans to use her influence to try to affect the Brexit negotiations as well, suggesting that she believes the UK should try to remain in the EU single market, our editor adds.
Other members of the party have criticised Mrs May for staying on in Downing Street after failing to secure a majority government.
Former business minister Anna Soubry called for her to “consider her position” after a “disastrous” election campaign.
Labour has also demanded her resignation, with leader Jeremy Corbyn saying Mrs May should “make way” for a government that would be “truly representative of the people of this country”.
The party won 262 seats in the election – up by 30 from 2015. With 40% of the vote, it also secured its biggest vote share since the 2001 election when Tony Blair won his second term as PM.
Mr Corbyn, who is expected to announce his shadow cabinet on Sunday, said his party was ready to form a minority government of its own, but stressed he would not enter into any “pacts or deals” with other parties.
Speaking on the BBC’s Question Time, Transport Secretary Chris Grayling defended the prime minister, saying she needed to stay in the role for the “foreseeable future”.
“Not only must she not resign, she has to not resign in the interest of the country because we need to move forward, we have got to go into the Brexit negotiations,” he added.
Sorry, your browser cannot display this content.
Find your result
Enter a postcode or seat name