Former Conservative minister and senior Brexit campaigner Michael Gove leaked the inaccurate story that the Queen was in favour of the UK leaving the European Union, former deputy prime minister Nick Clegg has claimed. Gove denies having anything to do with the story, which appeared on the front page of The Sun and prompted a rare complaint by the Palace, leading to a ruling by the Independent Press Standards Organisation (IPSO) that the headline was inaccurate.

The story, which appeared under the headline "Queen backs Brexit" on 9 March, claimed the monarch had "let rip" at Clegg about the EU five years earlier. Clegg denied all knowledge of the conversation.

Shortly after the story appeared the Palace said in a statement: "The Queen remains politically neutral, as she has for 63 years. We would never comment on spurious, anonymously sourced claims. The referendum will be a matter for the British people."

The vote to leave the EU had huge political ramifications, with David Cameron's resignation as prime minister leading to a contest to replace him during which Gove failed to back former friend and Brexit campaigner Boris Johnson.

Gove then failed to secure the backing of fellow MPs to get a nomination for the leadership election, leading to Theresa May being appointed leader of the Conservatives, and the UK's second female Prime Minister.

Once in office, May appointed Johnson as foreign secretary, in a controversial move, and left Gove in the political wilderness, returning him to the back benches.

The events of the summer are the subject of a new BBC documentary, Brexit: The Battle for Britain, in which Clegg, MP for Sheffield Hallam, makes the claim about Gove.

Gove has always denied being behind the story. He tells the BBC programme, presented by BBC political editor Laura Kuenssberg: "Well as I've said before I don't know how The Sun got all its information, and I don't think it's really worth my adding anything to what's already been said about this story."