"I don't believe any self-respecting minister would accept such conditions and so, therefore, I felt the best thing to do was to go".
The prime minister demanded that Javid fire all five of his most senior aides but the chancellor refused and quit, according to three people familiar with the matter.
The chancellor of the Exchequer said he had "no option but to resign" after Johnson offered to keep him on but only if he got rid of all his political advisers.
But the finance minister's resignation - which some commentators said might have been sought by Johnson's team - due to a dispute over Javid's advisers added to the picture that the prime minister will not tolerate dissent in his government.
Rumour has it that Rishi Sunak will replace Javid but his appointment comes with a catch, in the sense that there will be special advisers from No. 10 that he has to work with.
Javid's spokesman confirmed he would be leaving just as Prime Minister Boris Johnson carried out the first reshuffle of his cabinet since winning a parliamentary majority in December's election.
Great Yarmouth MP and former party chairman Brandon Lewis will take over from sacked minister Julian Smith as secretary of state for Northern Ireland.
The government said Thursday that Alok Sharma, previously in charge of worldwide development, would become business secretary and also take charge of COP26.
Shadow Chancellor John McDonnell said Mr Javid's resignation had left the Government in crisis. The 39-year-old is set to move into No. 11 Downing Street, next door to the Prime Minister's Office.
Several high-profile women in Johnson's government, including Business Secretary Andrea Leadsom and Housing Minister Esther McVey, were fired.
An analyst with Goldman Sachs before joining politics in 2014, Sunak, whose grandparents were from Punjab and emigrated to the United Kingdom from east Africa, is MP from Richmond (Yorkshire).
Ex-Brexit secretary Stephen Barclay replaces Mr Sunak as Treasury chief secretary.
Anne-Marie Trevelyan joins the Cabinet as International Development Secretary, having previously been a defence minister. Michael Gove also retains his post as Chancellor of the Duchy of Lancaster and Minister for the Cabinet Office.