Damian Green, one of Theresa May's closest allies, has resigned his position as First Secretary of State.

An investigation over allegations Green had been found with pornographic material on parliamentary computers found that previous statements he had made about the matter were "inaccurate and misleading".

Green had been under investigation after claims that "extreme" pornography had been found on his parliamentary computer in 2008.

In his resignation letter, Green said that he had "been asked to resign from the government following breaches of Ministerial Code, for which I apologise.

"From the outset I have been clear that I did not download or view pornography on my Parliamentary computers," Green wrote.

"I accept that I should have been clear in my press statements that police lawyers talked to my lawyers in 2008 about the pornography on the computers, and that the police raised it with me in a subsequent phone call in 2013."

Green also used his letter to apologise to journalist, Kate Maltby who had previously accused the minister of harassment and whose case formed a part of the investigation.

"I deeply regret the distress caused to Kate Maltby following her article about me and the reaction to it. I do not recognise the events she described in her article, but I clearly made her feel uncomfortable and for this I apologise."

Damian Green
First Secretary of State Damian Green had vehemently denied that 'extreme porn' was found on his parliamentary computer during a 2008 police raid. Carl Court/Getty Images

In her reply, Theresa May said she was "extremely sad to be writing this letter" and that she appreciated his apology to Maltby.

The investigation into Green concluded that his conduct as a minister "has generally been both professional and proper" but that while there were "competing and contradictory accounts", Maltby's accusations were "plausible".

"Mr Green's statements of 4 and 11 November, which suggested that he was not aware that indecent material was found on parliamentary computers in his office, were inaccurate and
misleading, as the Metropolitan Police Service had previously informed him of the existence of this material," a summary of the investigation said.

"These statements therefore fall short of the honesty requirement of the seven principles of public life and constitute breaches of the ministerial code. Mr Green accepts this."