Treasury Chief Secretary David Laws became the coalition's first casualty after it emerged he had channelled tens of thousands of pounds of public money in rent to his secret boyfriend.
Announcing his departure, the Liberal Democrat said: "I do not see how I can carry out my crucial work on the Budget and spending review while I have to deal with the private and public implications of recent revelations."
Prime Minister David Cameron praised millionaire Mr Laws as a "good and honourable man", suggesting he could return to government "in time".
And Lib Dem deputy PM Nick Clegg said the Yeovil MP's downfall had been caused purely by his desire for privacy, which had now been "cruelly shattered".
The loss of Mr Laws, after just 17 days in office, is a major setback for the Tory-Lib Dem coalition.
He was a pivotal figure in negotiations between the parties after the inconclusive general election result and has since impressed Conservatives with the vigorous way he set about implementing spending curbs.
Mr Laws has been replaced by Danny Alexander, another key figure in coalition talks, who will now take centre stage in pushing through the Government's drastic programme of cuts. His former role of Scottish Secretary has been taken by Lib Dem colleague Michael Moore.
In his resignation letter - much of which he read out in an extraordinary, emotional personal statement delivered at the Treasury last night - Mr Laws wrote: "While my recent problems were caused by my desire to keep my sexuality secret, the public is entitled to expect politicians to act with a sense of responsibility.
"I cannot now escape the conclusion that what I have done was in some way wrong, even though I did not gain any financial benefit from keeping my relationship secret in this way."
He added: "I have pursued a political career because of my sense of public duty, but I have too often put this before the interests of those I love most. It is time to redress the balance."
Responding to the resignation letter, Mr Cameron wrote: "The last 24 hours must have been extraordinarily difficult and painful for you.
"You are a good and honourable man. I am sure that, throughout, you have been motivated by wanting to protect your privacy rather than anything else. Your decision to resign from the Government demonstrates the importance you attach to your integrity.
"In your short lime at the Treasury, you have made a real difference, setting the Government on the right path to tackle the deficit which poses such a risk to our economy."
Mr Clegg added: "There are clearly questions that David himself acknowledges must now be answered about his own expenses, and he did the right thing referring himself to the Parliamentary Commissioner for Standards.
"When these questions have been addressed, I very much hope that there will be an opportunity for him to rejoin the Government."
Chancellor George Osborne also expressed his sadness at Mr Laws' departure.
"I am very sorry to lose David from the Treasury," he said. "It was as if he had been put on earth to do the job that was asked of him."
Business Secretary Vince Cable said a "sad situation" had been "resolved in the proper way".
"We use this jargon about being socially liberal but actually the issue of people being comfortable coming out and talking about these things with friends and family is not easy. There are still big hurdles in society to people doing that," he added.
The announcement came after a day of fevered speculation in the wake of the Daily Telegraph's expose, which led to Mr Laws dramatically admitting he was gay and referring himself to the parliamentary standards commissioner.
According to the newspaper, between 2004 and 2007, Mr Laws claimed between 700 and 950 a month to sub-let a room in a flat in Kennington, south London, from his secret long-term partner, lobbyist James Lundie.
Mr Lundie sold the flat for a profit of 193,000 in 2007, buying another house nearby for 510,000.
The MP then began claiming to rent the "second bedroom" in this property. His claims increased to 920 a month. The partner also lived at the property. Mr Laws' main home is in his Yeovil constituency.
The arrangement continued until September 2009, when Parliamentary records indicate that Mr Laws switched his designated second home and began renting another flat at taxpayers' expense. His partner remained at the Kennington house.
Since 2006, Parliamentary rules have banned MPs from "leasing accommodation from a partner".
Lib Dem colleagues including former leader Paddy Ashdown and Taunton MP Jeremy Browne rallied round Mr Laws, saying he had merely wanted to protect his privacy and warning against a "witch hunt".
But Labour MPs questioned whether he should stay in post, and Sir Alistair Graham, former chairman of the Committee on Standards in Public Life, suggested Mr Laws should stand down while the matter was investigated.
International Development minister Alan Duncan, the first openly gay Tory MP, said of Mr Laws' resignation: "This is a sad and upsetting time and most people will wish him well.
"David is a much liked and talented person whose progress we all valued. I'm upset by the hurt this must have caused him and I hope he'll soon be back."
Work and Pensions Secretary Iain Duncan Smith said his respect for Mr Laws had grown since they started working together in the coalition, and he was a "thoroughly decent person".
"I am deeply sorry that he has had to go," Mr Duncan Smith told the BBC's Andrew Marr programme. "I think on balance he is right. If you have got the toughest job in Government to try and find the savings, you cannot be beset by personal problems."