The extent of the Queen and Prince Charles's secretive power of veto over new laws has been exposed after Downing Street lost its battle to keep information about its application secret.

Whitehall papers prepared by Cabinet Office lawyers show that overall at least 39 bills have been subject to the most senior royals' little-known power to consent to or block new laws. They also reveal the power has been used to torpedo proposed legislation relating to decisions about the country going to war.

The internal Whitehall pamphlet was only released following a court order and shows ministers and civil servants are obliged to consult the Queen and Prince Charles in greater detail and over more areas of legislation than was previously understood.

The new laws that were required to receive the seal of approval from the Queen or Prince Charles cover issues from higher education and paternity pay to identity cards and child maintenance.

In one instance the Queen completely vetoed the Military Actions Against Iraq Bill in 1999, a private member's bill that sought to transfer the power to authorise military strikes against Iraq from the monarch to parliament.

She was even asked to consent to the Civil Partnership Act 2004 because it contained a declaration about the validity of a civil partnership that would bind her.

In the pamphlet, the Parliamentary Counsel warns civil servants that if consent is not forthcoming there is a risk "a major plank of the bill must be removed".

"This is opening the eyes of those who believe the Queen only has a ceremonial role," said Andrew George, Liberal Democrat MP for St Ives, which includes land owned by the Duchy of Cornwall, the Prince of Wales' hereditary estate.

"It shows the royals are playing an active role in the democratic process and we need greater transparency in parliament so we can be fully appraised of whether these powers of influence and veto are really appropriate. At any stage this issue could come up and surprise us and we could find parliament is less powerful than we thought it was."

Charles has been asked to consent to 20 pieces of legislation and this power of veto has been described by constitutional lawyers as a royal "nuclear deterrent" that may help explain why ministers appear to pay close attention to the views of senior royals.

The guidance also warns civil servants that obtaining consent can cause delays to legislation and reveals that even amendments may need to be run past the royals for further consent.

"There has been an implication that these prerogative powers are quaint and sweet but actually there is real influence and real power, albeit unaccountable," said John Kirkhope, the legal scholar who fought the freedom of information case to access the papers.

The release of the papers comes amid growing concern in parliament at a lack of transparency over the royals' role in lawmaking. George has set down a series of questions to ministers asking for a full list of bills that have been consented to by the Queen and Prince Charles and have been vetoed or amended.

The guidance states that the Queen's consent is likely to be needed for laws affecting hereditary revenues, personal property or personal interests of the Crown, the Duchy of Lancaster or the Duchy of Cornwall.

Consent is also needed if it affects the Duchy of Cornwall. These guidelines effectively mean the Queen and Charles both have power over laws affecting their sources of private income.

The Queen uses revenues from the Duchy of Lancaster's 19,000 hectares of land and 10 castles to pay for the upkeep of her private homes at Sandringham and Balmoral, while the prince earns £18m-a-year from the Duchy of Cornwall.

A Buckingham Palace spokeswoman said: "It is a long established convention that the Queen is asked by parliament to provide consent to those bills which parliament has decided would affect crown interests. The sovereign has not refused to consent to any bill affecting crown interests unless advised to do so by ministers."

A spokesman for Prince Charles said: "In modern times, the prince of Wales has never refused to consent to any bill affecting Duchy of Cornwall interests, unless advised to do so by ministers. Every instance of the prince's consent having been sought and given to legislation is a matter of public record."

Graham Smith, director of Republic, the campaign for an elected head of state, has also called for full disclosure of the details of the occasions when royal consent has been refused.

"The suggestion in these documents that the Queen withheld consent for a private member's bill on such an important issue as going to war beggars belief," he said. "We need to know whether laws have been changed as the result of a private threat to withhold that consent."

The Cabinet Office fought against the publication of the 30-page internal guidance in a 15-month freedom of information dispute. It refused a request to release the papers from Kirkhope, a notary public who wanted to use them in his graduate studies at Plymouth University.

It was ordered to do so by the Information Commissioner. The Cabinet Office then appealed that decision in the Information Tribunal but lost.

Royal influence

Here is a list of government bills that have required the consent of the Queen or the Prince of Wales. It is not exhaustive and in only one case does it show whether any changes were made. It is drawn from data gleaned from two Freedom of Information requests.

The Queen

Agriculture (miscellaneous provisions) bill 1962

Housing Act 1996

Rating (Valuation Act) 1999

Military actions against Iraq (parliamentary approval bill) 1999 – consent not signified

Pollution prevention and control bill (1999)

High hedges bills 2000/01 and 2002/03

European Union bill 2004

Civil Partnership Act 2004

Higher Education Act 2004

National Insurance Contributions and Statutory Payments Act 2004

Identity cards bill 2004-06

Work and families bill 2005-06

Commons bill 2006

Animal Welfare Act 2006

Charities Act 2006

Child maintenance and other payments bill (2006/07)

Rating (Empty Properties) Act 2007

Courts, Tribunals and Enforcement Act 2007

Corporate Manslaughter and Corporate Homicide Act 2007

Fixed term parliaments bill (2010-12 session)

Prince Charles

Conveyancing and Feudal Reform (Scotland) Act 1970

Land Registration (Scotland Act) 1979

Pilotage bill 1987

Merchant Shipping and Maritime Security Act 1997

House of Lords Act 1999

Gambling bill 2004-05

Road Safety bill 2004-05

Natural environment and rural communities bill 2005-06

London Olympics bill 2005-06

Commons bill 2006

Charities Act 2006

Housing and regeneration bill 2007-08

Energy bill 2007-08

Planning bill 2007-08

Co-operative and community benefit societies and credit unions bill 2008-09

Local Democracy, Economic Development and Construction (Lords) 2008-09

Marine and Coastal Access (Lords) 2008-09

Coroners and justice bill 2008-09

Marine navigation aids bill 2009-2010

Wreck Removal Convention Act 2010-12

• This article was amended on Tuesday 15 January 2013 because it stated that Prince Charles has used the veto on more than a dozen occasions when it should have said that he has been asked to consent to 20 pieces of legislation.