Former Tory MP Gavin Barwell will replace the duo as Mrs May's new Downing Street chief of staff.
The change was unlikely to significantly quell unrest within the party.
Downing Street initially said on Saturday that an outline agreement on a "confidence and supply" arrangement had been reached with the DUP which would be put to the Cabinet for discussion on Monday.
That means it will support a Conservative minority government on key votes in parliament without a formal coalition deal.More news: EAA opposes White House plan to privatize air traffic control system
But former party leader Iain Duncan Smith said a leadership contest now would be a "catastrophe".
But the wooing of the DUP risks upsetting the political balance in Northern Ireland by aligning London more closely with the pro-British side in the divided province, where a power-sharing government with Irish nationalists is now suspended.
May is now looking to rule the country with less than 50% of seats in Parliament's House of Commons, and is banking on support from the DUP to be the ally that helps her party push its agenda through Parliament. While May initially claimed how she was up for Brexit as she wanted to take Britain out of the European Union's single market and customs union and consequently cut immigration.
Her party is deeply divided over what it wants from Brexit.
British leader Theresa May sought to frame the campaign around her personal leadership heading into Brexit, but this was undermined by public performances derided as robotic.
With talks between the Tories and the DUP expected to begin within days, Sinn Fein's Alex Maskey expressed concern about the impact of any deal on the peace process.
Last December, Hill also told senior Conservative lawmaker Nicky Morgan to keep away from Downing Street after criticising the premier for her expensive leather pants.
"She's then got to present a programme to Parliament".More news: Jayalalithaa's niece Deepa Jayakumar creates flutter at her residence
"She's staying, for now", one Conservative Party source told Reuters.
The atmosphere in the Conservative Campaign HQ was said to have turned toxic.
Newspaper headlines saw her as just clinging on.
But the Conservatives remain the largest party in Parliament, and Mr Corbyn's plan to vote down Mrs May looks mathematically doomed to fail.
Ministers have reportedly accused the two special advisers of acting like deputy Prime Ministers over their stranglehold on power in Whitehall.
Speaking on ITV, Mr Flanagan said he has raised the matter with Northern Ireland Secretary James Brokenshire, although it remains to be seen what deal is agreed between the Conservatives and the DUP. The Labor Party received 262 mandates, the Scottish National Party - 35 seats. German Chancellor Angela Merkel said she saw no reason to grant the United Kingdom a grace period.More news: Church bus crash in Alabama leaves one dead, several injured
- UK Prime Minister Theresa May says she'll stick to Brexit timetable
- Northern Ireland's DUP says could help Britain's May reach majority
- Champions Trophy: Best OPPO Moments from Sri Lanka-South Africa game
- Kumble likely to be retained as head coach
- United Kingdom police seek clues from pink knives used in London Bridge attack
- UK leader May strikes tentative deal with Northern Ireland party
- 'Mastermind' of Tehran terrorist attacks killed by Iranian security forces
- PM Theresa May to cling on to power despite snap election disaster
- Trump calls Comey a liar
- Ferraris (Vettel, Raikkonen) fastest in Canadian GP practice