Liam Fox tonight resigned as Defence Secretary over his links with his close friend, lobbyist Adam Werritty.
In a letter to Prime Minister David Cameron, Dr Fox said that he had "mistakenly" allowed the distinction between his personal interest and government activities to become "blurred".
"I have also repeatedly said that the national interest must always come before personal interest. I now have to hold myself to my own standard," he said.
"I have therefore decided, with great sadness, to resign from my post as Secretary of State for Defence - a position which I have been immensely proud and honoured to have held."
In his response, Mr Cameron paid tribute to the "superb job" which Dr Fox had done at the Ministry of Defence.
"I understand your reasons for deciding to resign as Defence Secretary, although I am very sorry to see you go," he said.
"We have worked closely for these last six years, and you have been a key member of my team throughout that time."
The announcement comes after days of damaging speculation over the relationship between Dr Fox and his 33-year-old best man and former flatmate.
Mr Werritty was questioned for a second time today by a senior official from the Cabinet Office as part of the Whitehall investigation headed by Sir Gus O'Donnell.
Employment Minister Chris Grayling, a close ally of Dr Fox who was his campaign manager during the 2005 campaign for the Conservative leadership, said he had taken a "brave and probably correct decision".
Mr Grayling, who spoke to the former defence secretary following his decision to resign, told the Press Association: "It is a great shame. I am very saddened for Liam.
"He has done a really good job in turning around the Ministry of Defence at an extraordinarily difficult time.
"I very much hope that in due course he will be able to make a return to government."
Shadow defence secretary Jim Murphy said: "This was unavoidable and inevitable.
"Throughout these events I haven't called for Liam Fox's resignation but just the full truth.
"Governments must have rules and ministers must have standards. Liam Fox fell foul of the standards and he broke the rules. It was clear early on that he had breached the Ministerial Code."
He added: "This issue has centred solely on his judgment and his conduct in one of the most serious jobs in the country.
"With so much at stake for our forces, the Defence Secretary must be focused solely on his public duties.
"The Government has shown how out of touch it is by spending the whole of the last week worrying about how to save Liam Fox's job. That time should have been better spent trying to save the jobs of tens of thousands of hard-working people."
Tory backbencher Mark Pritchard said he hoped Dr Fox could return to government at some stage.
"Liam Fox will be remembered as a defence secretary who started the necessary fundamental reform of the Ministry of Defence," he said.
"He inherited a £38 billion black hole from Labour which he successfully tackled while maintaining the necessary levels of defence for the nation.
"That reconciliation was a very difficult test yet he undertook it with skill and understanding of defence issues."
He added: "I hope that in the future he could return to the government."
Senior Tory backbencher Bernard Jenkin, a former shadow defence secretary, told PA: "I am very sorry that Liam has felt compelled to resign, but he will know that he is doing the right thing.
"The main concern must now be to ensure continuity in the MoD, one of the most challenging of departments, at a time when our armed servicemen and women are highly stretched on combat operations."
Former Liberal Democrat leader Sir Menzies Campbell said: "Dr Fox has bowed to the inevitable. It had become impossible for him to draw a line under the story.
"These events had undoubtedly begun to affect his authority and the morale of his Department."
Other MPs paid tribute to the former Defence Secretary on Twitter.
Defence Minister Peter Luff said: "For the record, Liam Fox was doing a genuinely outstanding job in Defence, driving through essential change - change we must continue."
Corby MP Louise Mensch said she was "very sorry indeed" at Dr Fox's resignation, describing him as "an outstanding Secretary of State for Defence and a completely dedicated minister".
Daventry MP Chris Heaton-Harris wrote: "So the best Defence Secretary since 1997 has resigned. Very sorry for Liam & for Jesme."
Dr Fox telephoned Mr Cameron in his Oxfordshire constituency to inform him of his decision to resign.
It is understood that the Prime Minister had been prepared to let him carry on until Sir Gus had completed his inquiry - despite the prospect of another weekend of damaging headlines - before reaching a decision.
Dr Fox received strong support from Tory backbenchers when he appeared in the Commons on Monday and, despite a difficult relationship in the past, Mr Cameron appeared reluctant to wield the axe unless it was clear he to go.
There has been no suggestion that Dr Fox profited personally in any way from the relationship, but there have been increasing questions as to what Mr Werritty and backers were getting from it.
Many of his supporters share Dr Fox's strong pro-Atlanticist, pro-Israel views and MPs have questioned whether he was effectively running a parallel private operation, circumventing his official civil service private office.
Labour MP Dan Jarvis (Barnsley Central), a former officer in the Paras, said Dr Fox had done "the right thing" by resigning.
"Over the last week we have been shocked by the facts which have come to light over numerous breaches of the Ministerial Code," said Mr Jarvis. "Liam Fox has fallen short of the standards expected by our Armed Forces on the front line, the electorate and his colleagues.
"The Prime Minister has spent the last week trying to save the job of Liam Fox, when his efforts would have been best served trying to save the jobs of thousands of military personnel who face redundancy and thousands of people across the country who are worried about their future in the current climate."
Defence Minister Peter Luff said he hoped Dr Fox would be able to return to government after a period on the backbenches.
Mr Luff told BBC News: "As a minister he was genuinely outstanding. He had that clarity of purpose and that firmness of purpose which you need to be a Cabinet minister, and we haven't got many of them in British politics.
"We need people of quality and I think the country would be well-served by his return in due course."
Conservative MP Bob Stewart (Beckenham), a former Army officer who served as UN commander in Bosnia, paid tribute to Dr Fox, telling the BBC: "Fundamentally he was well-respected and he has done a seriously good job in the Ministry of Defence in my view.
"Now Liam Fox has resigned, we need urgently to have a new Secretary of State for Defence in post, because these shenanigans don't actually help our Armed Forces, who are fighting a bloody conflict in Afghanistan."
Mr Cameron later said he was "sorry" to see Dr Fox go and would be announcing a new Defence Secretary "very shortly".
In a televised comment filmed in his Oxfordshire constituency, the Prime Minister said: "I quite understand why Liam Fox has decided to resign, though obviously I am sorry to see him go.
"He did a good job at the Ministry of Defence, clearing up the mess left by the last government and giving good leadership to that department, particularly while we have been in action in Libya and also, of course, in Afghanistan as well.
"I wish him well for the future and I will be announcing a replacement very shortly."
Asked whether he had made an error of judgment in allowing the affair to run on all week, the Prime Minister said: "I think it is quite right to take the time to establish the facts in a case, rather than rushing to judgment."
Former Defence Secretary and Conservative MP for Kensington, Sir Malcolm Rifkind told BBC Radio 4's PM programme Dr Fox's resignation was "inevitable, given what has emerged in the last few days".
Asked what Dr Fox was guilty of, he said "poor judgment", adding: "There's no hint of impropriety, or corruption or illegality or anything of that kind, but believing that he could have this private arrangement that enabled him to maintain lots of political contacts and pursue some of his political objectives in parallel with being a Secretary of State, but with the framework of Government, that was going to be an accident waiting to happen."
He added he was "very pleased" the decision was one that Dr Fox took himself, rather than one that was forced upon him simply by the "remorseless pressure of the events" day after day.