The PM's ethics adviser has quit a day after saying there was a "legitimate question" about whether Boris Johnson broke ministerial rules over Partygate.
Lord Geidt did not give a reason for leaving the role he took in 2021, but said it was the "right thing" to do.
His predecessor, Sir Alex Allan, quit in 2020 after Mr Johnson overruled him over a report into alleged bullying by Home Secretary Priti Patel.
The government said it was "surprised" by Lord Geidt's decision.
"Whilst we are disappointed, we thank Lord Geidt for his public service," a spokesperson added.
The spokesperson gave no reason for the resignation but said Lord Geidt had been asked this week "to provide advice on a commercially sensitive matter in the national interest, which has previously had cross-party support. No decision had been taken pending that advice".
No 10 did not make it clear what these comments referred to.
Justice Secretary Dominic Raab said there were "questions around the detail of the resignation" and said No 10 would provide an update later on Thursday.
He added that Lord Geidt had had a "pretty rough grilling by MPs this week" and that media an politicians "maybe underestimate how civil servants feel with that kind of scrutiny".
A Downing Street source told the BBC that Lord Geidt's resignation had been a "total surprise and a mystery" to the prime minister, adding: "Only on Monday Lord Geidt asked if he could stay on for six months."
Labour's Chris Bryant, chairman of the Commons' Committee on Standards and Privileges, told Radio 4's Today that Lord Geidt's resignation letter should be published, adding: "I hope the Cabinet Office will publish that letter today,"
Sir Philip Mawer, a former parliamentary commissioner for standards, echoed these calls and said: "If the letter and the prime minister's reply are not published then I think people will draw their own conclusion and it will not be favourable."
He said he had been "disappointed but not surprised" at Lord Geidt's resignation, adding there had been a "succession of failures" on the part of the prime minister and "it's not just Partygate".
Labour deputy leader Angela Rayner said: "The prime minister has now driven both of his own handpicked ethics advisers to resign in despair.
"If even they can't defend his conduct in office, how can anyone believe he is fit to govern?"
Liberal Democrat chief whip Wendy Chamberlain said: "When both of Boris Johnson's own ethics advisers have quit, it is obvious that he is the one who needs to go."
Who is Lord Geidt?
- Born in 1961, Christopher Geidt is a former army intelligence officer who later worked as a diplomat in Sarajevo, Brussels and Geneva
- In 2002, he began working for the Royal Household and served as the Queen's private secretary for 10 years from 2007
- He stepped down after a "power struggle" between Buckingham Palace and the Prince of Wales, the Times reported in 2017
- Lord Geidt is chairman of King's College London and also chairs a board of the investment firm Schroders
- He lives on the Isle of Lewis in the Outer Hebrides, where he grew up and where he now has a sheep farm. He is married with two daughters
Former cabinet secretary Lord Turnbull said of Mr Johnson: "The pattern of behaviour is that anyone who has the power to criticise, obstruct or force him to change, he will try to reduce their power, suborn them or in the last resort wave them aside."
But he told BBC Newsnight that "the charge sheet of Boris Johnson's conduct is now so long that one accusation isn't going to make any difference", adding the prime minister would only leave office if he was removed as Tory leader by MPs.
It was reported that Lord Geidt had threatened to quit last month after the publication of the Sue Gray report into lockdown breaches in Downing Street unless Mr Johnson issued a public explanation for his conduct.
Appearing before a committee of MPs on Tuesday, Lord Geidt said: "Resignation is one of the rather blunt but few tools available to the adviser. I am glad that my frustrations were addressed in the way that they were."
But, in a brief written statement on Wednesday, he said: "With regret, I feel that it is right that I am resigning from my post as independent adviser on ministers' interests."
Geidt's discomfort in the job was evident
On Wednesday evening, Lord Geidt phoned the prime minister's principal private secretary to tell him he was resigning. Mr Johnson was informed of the decision at about 18:30 BST, shortly after finishing a phone call with Ukraine's President Volodymyr Zelensky.
But while the particular timing has surprised some in Downing Street, Lord Geidt's discomfort in the job has been evident for a while.
Just last month he had said in a report that it was a legitimate question to ask if Boris Johnson had breached the ministerial code by breaking Covid laws.
Lord Geidt also spelled out in the report that he didn't like the terms of his job - "the prevailing arrangements still remained insufficiently independent to be able to command the confidence of the public" as he put it.
But the truth is we don't yet know definitively why Lord Geidt resigned, as his resignation letter has not been published - which itself is unconventional.
The prime minister is expected to write back to Lord Geidt on Thursday morning, and that reply may well be made public.
Mr Johnson was fined in April over a surprise birthday party in his honour that he attended in Downing Street in June 2020.
Writing to Lord Geidt afterwards, he said there had been "no intent" to break Covid regulations", and that he had been "fully accountable to Parliament and the British people".
The ministerial code, which outlines the rules government ministers must follow, says there is an "overarching duty" on them to comply with the law.
If the code is broken, the convention in Westminster is for a minister to resign.
In his annual report on ministers' interests, published on 1 June, Lord Geidt said questions around Mr Johnson's behaviour had led to an "impression... the prime minister may be unwilling to have his own conduct judged against" the ministerial code.
He said that, when it came to the Partygate fine, "a legitimate question has arisen as to whether those facts alone might have constituted a breach of the overarching duty within the ministerial code of complying with the law".
Following Lord Geidt's resignation, Tory MP William Wragg, whose Public Administration and Constitutional Affairs Committee questioned the adviser on Tuesday, described him as "a person of great integrity, motivated by the highest ideals of public service".
Mr Wragg, a critic of Mr Johnson, added: "For the PM to lose one adviser on ministers' interests may be regarded as a misfortune. To lose two looks like carelessness."