Liam Fox, Britain's defense minister leaving the Ministry of Defence building on October 13.

Story highlights

British Defence Minister Liam Fox resigns amid uproar over friend

He apologizes to British Prime Minister David Cameron in letter

Fox says he will continue to represent constituents

London CNN  — 

Liam Fox, Britain’s defense minister, has resigned amid an uproar over a friend who worked as an adviser but didn’t have an official governmental position.

“I mistakenly allowed the distinction between my personal interest and my government activities to become blurred. The consequences of this have become clearer in recent days. I am very sorry for this,” he said in a letter on Friday to Prime Minister David Cameron. He said he will continue to represent his constituents in North Somerset.

“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 honored to have held.”

Fox said he is proud of reforms he has overseen at the ministry and for the country’s armed forces and for his role “in helping to liberate the people of Libya.”

“I regret that I will not see through to its conclusion Britain’s role in Afghanistan, where so much progress has been made.”

He praised military personnel and said he was honored to work with them.

“I appreciate all the support you have given me – and will continue to support the vital work of this government, above all in controlling the enormous budget deficit we inherited, which is a threat not just to this country’s economic prosperity but also to its national security,” he said.

Cameron told Fox in a letter that he was “very sorry” about his departure, saying he’s done “a superb job in the 17 months since the election, and as shadow defence secretary before that.”

The prime minister pointed to his overseeing of “fundamental changes” in the British Defence Ministry and the military.

“On Libya, you played a key role in the campaign to stop people being massacred by the Gadhafi regime and instead win their freedom,” he said.

He said Fox could be “proud of the difference” he made in office and in helping the Conservatives return to government.

“I appreciate your commitment to the work of this government, particularly highlighting the need to tackle the deficit, and the relationship between Britain’s economic strength and our national security,” Cameron said.

CNN’s James Partington contributed to this report