Johnson last week survived a confidence ballot that saw 41% of his lawmakers vote against his leadership after months of scandals and gaffes that have raised questions over his authority to govern and knocked his standing with the public.
The resignation of Christopher Geidt marks the second Independent Adviser on Ministers' Interests to quit under Johnson in less than two years.
"With regret, I feel that it is right that I am resigning from my post as Independent Adviser on Ministers' Interests,'' Geidt announced on the UK government website, without providing a reason why.
Taking questions from a parliamentary committee on Tuesday, Geidt said the fact Johnson was fined by police for breaking his own government's rules on lockdown gatherings could be in breach of the Ministerial Code.
"If I am to take the view of say the ordinary man or woman [...] it's reasonable to say that perhaps a fixed penalty notice and a Prime Minister paying for it, may have constituted not meeting the overarching duty under the ministerial code of complying with the law," Geidt told lawmakers.
He also declined to deny when asked if he had contemplated resigning over the "Partygate" scandal.
In response to his resignation, a UK government spokesperson issued a statement which said: "We are surprised by this decision, given Lord Geidt's commitment to the role, to the Prime Minister, and in his evidence to the House of Commons just yesterday.
"This week, the Independent Adviser was asked 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. Whilst we are disappointed, we thank Lord Geidt for his public service. We will appoint a new adviser in due course."
Geidt, the Queen's private secretary for 10 years until 2017, was appointed by Johnson in April 2021. His predecessor, Alex Allen, resigned in November 2020 after Johnson backed Home Secretary Priti Patel despite Allen's report finding her to have breached the Ministerial Code for allegedly bullying civil servants.