Prime Minister David Cameron and his wife Samantha leave 10 Downing Street for the last time in 2016. (Christopher Furlong/Getty Images)

Former Tory prime minister David Cameron says he has “absolutely no regrets” about introducing same-sex marriage to England and Wales.

In an extract of his forthcoming book, ‘For The Record’, published in The Times, Cameron calls introducing same-sex marriage to the UK “one of the things of which I’m proudest”.

“Equal marriage was one of the most contentious, hard-fought and divisive issues during my time as prime minister,” Cameron said.

“We would lose party members; one even came to my surgery and tore up their membership card in front of me. It was an issue that I would worry and even wobble over. But I have absolutely no regrets, and it is one of the things of which I’m proudest.”

Cameron was the Conservative prime minister from 2010 to 2016 – he resigned after the results of the EU referendum, which he had called – having been leader of the Conservatives since 2005.

Ahead of the first same-sex weddings in the UK, which took place in March 2014, Cameron wrote for PinkNews that marriage is “a wonderful institution” that should be “available to gay people and lesbians”.

“I am proud of the work this government has done and is doing to allow gay and lesbian couples to have their love for each other recognised in this way,” he said.

Before the 2010 election, Cameron had promised a PinkNews reader in a Q&A that he would consider the case for same-sex marriage. The Conservative’s equality manifesto, authored by Theresa May before the 2010 election, also committed the party to considering the case for same-sex marriage.

“In ‘coming out’ for gay marriage, in some ways I surprised myself,” Cameron writes in ‘For The Record’.

“I was on the wrong side of Section 28. I also ended up abstaining on — rather than voting against — Iain Duncan Smith’s rejection of gay couples’ right to adopt. I should have proactively supported that right.”

He goes on to explain that his wife, Samantha, was “forceful” in telling him that his arguments for backing civil partnerships in 2004 – “ensuring that gay couples weren’t discriminated against when it came to important details like hospital visiting rights, inheritance and rights for bereaved partners” – were “the right conclusion, but the wrong argument”.

“There was a far bigger point staring me in the face,” Cameron said. “People should be able to enter into a legal union with the person they love.”

Although it’s been five years since the first same-sex weddings in England and Wales, they are still banned in Northern Ireland.