Fox, seen as a close ally of prime minister David Cameron, admitted that he had “'mistakenly allowed the distinction between my personal interest and my Government activities to become blurred'.
The government has named transport minister Philip Hammond as his replacement to lead the ministry of defence, but the move will require the prime minister to reshuffle many cabinet positions.
A stream of damaging speculation about Fox’s dealings with Werritty, best man at his wedding, had raised questions over his judgment as defence secretary.
It emerged that Werritty had attended 40 meetings alongside Fox with defence companies and foreign government officials in the past 18 months, with his expenses apparently funded by lobbying and intelligence companies.
Fox had been defence secretary for 17 months since the last election and previously served in government in the 1990s. He stood against Cameron for the leadership of the Conservative party in 2005.
In his letter of resignation, Fox said: “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.
“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.”
Cameron responded by saying Fox had done “a superb job” and he was very sorry to see him go. “I understand your reasons,” he added.