David Laws has resigned as Chief Secretary to the Treasury after it was revealed he paid almost £40,000 in expenses to his secret boyfriend.

Mr Laws, a Liberal Democrat, is the first casualty of the coalition. Yesterday, the Daily Telegraph reported he broke parliamentary rules by paying the money to his male partner James Lundie.

He resigned this evening in a letter to prime minister David Cameron.

Mr Laws wrote: “I do not see how I can carry on my crucial work on the budget and spending review while I have to deal with the private and public implications of recent revelations. At this important time the chancellor needs, in my own view, a chief secretary who is not distracted by personal troubles.”

He added: “I hardly need to say how much I regret having to leave such vital work, which I feel all my life has prepared me for.”

Mr Cameron replied: “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. I hope that in time you will be able to serve again as I think it absolutely clear that you have a huge amount to offer our country.”

New rules brought in during 2006 barred MPs for claiming money for rent which was to be paid to their partners. As Mr Laws had kept his relationship secret from even his family and friends, parliamentary officials were unaware he was paying the money to his partner.

The Daily Telegraph revealed that between 2004 and 2009, Mr Laws claimed more than £40,000 rent rooms in properties in Kennington, south London, owned by Mr Lundie.

In 2007, Mr Lundie bought another house nearby for £510,000. Mr Laws then claimed £920 in rent on the second bedroom in this house.

Mr Laws designated his main home as being in his Yeovil constituency and claimed rent on a flat not owned by his partner when expenses rules were changed.

Downing Street announced this evening that fellow Liberal Democrat Danny Alexander will take over from Mr Laws as George Osborne’s deputy at the Treasury, while Michael Moore will replace Mr Alexander as Scottish Secretary.

In a statement yesterday, Mr Laws said: “I’ve been involved in a relationship with James Lundie since around 2001 — about two years after first moving in with him. Our relationship has been unknown to both family and friends throughout that time.

“James and I are intensely private people. We made the decision to keep our relationship private and believed that was our right. Clearly that cannot now remain the case.

“My motivation throughout has not been to maximise profit but to simply protect our privacy and my wish not to reveal my sexuality.”

Mr Laws’ sexuality was known by some in the Westminster village, including PinkNews.co.uk. He has a good record on LGBT issues and so this publication chose to respect his right to keep his sexuality secret.

His resignation means the cabinet returns to not having a single out gay politician.