A 165-year-old law that threatens to jail for life anyone who has called for the abolition of the monarchy in print has been repealed.

The controversial section three of the Treason Felony Act 1848, which has not been used to prosecute anyone since 1879, even made it an offence punishable by life imprisonment to "imagine" overthrowing the Crown or waging war against the Queen.

The section is one of 309 offences removed from the statute book in the year to May, the Ministry of Justice revealed.

Graham Smith, chief executive of Republic, which campaigns for a democratic alternative to the monarchy, said: "This is a law that should never have been put on the statute books, that should have been repealed decades ago. Although it has had no legal force for some time it is good to finally see it scrapped.

"Of course the republican campaign has been growing fast over recent years and this law has never been an obstacle - we have repeatedly publicly and unequivocally called for the abolition of the monarchy without any legal threat.

"We must be one of the last countries in Europe that has until this year had a law on the books that banned advocacy of greater democracy.

"If only for symbolic reasons, we have long called for the repeal of this law and we are pleased that Parliament now formally acknowledges that republicanism is a legitimate and mainstream point of view."

The section of the Act was challenged in the High Court in 2001 by The Guardian newspaper, which claimed the Act violated article 10 of the European Convention on Human Rights, which guarantees the right to free speech. The case was the first to be brought purely under the Human Rights Act, which at the time had been in force for just four months.

The challenge was launched after the paper's editor Alan Rusbridger was unable to gain official reassurance that a campaign calling for a referendum on the future of the monarchy would not lead to prosecutions under the Act.

The relevant section states that any person who "shall express, utter, or declare, by publishing any printing or writing", support for depriving the Queen of her crown faces life imprisonment.

After a renewed challenge in the Court of Appeal in 2002, an attempt was made by the then attorney general, Lord Goldsmith, to halt the move.

In 2003, five law lords in the House of Lords upheld Lord Goldsmith's move as they deemed the newspaper's actions to be unnecessary.

At the time, Lord Steyn said: "The part of section three of the 1848 Act which appears to criminalise the advocacy of republicanism is a relic of a bygone age, and does not fit into the fabric of our modern legal system.

"The idea that section 3 could survive scrutiny under the Human Rights Act is unreal."

And Lord Hutton warned it was not the job of the courts to keep statutes up to date and the Human Rights Act was not "an instrument by which the courts can chivvy Parliament into spring-cleaning the statute book".

Yesterday, it emerged "being an incorrigible rogue", under the Vagrancy Act 1824, had also been repealed.

A total of 327 criminal offences were also created in the year to May, a 12% increase compared with the previous 12 months.

In full, section three of the Treason Felony Act 1848 reads: "If any person whatsoever shall, within the United Kingdom or without, compass, imagine, invent, devise, or intend to deprive or depose our Most Gracious Lady the Queen, from the style, honour, or royal name of the imperial crown of the United Kingdom, or of any other of her Majesty's dominions and countries, or to levy war against her Majesty, within any part of the United Kingdom, in order by force or constraint to compel her to change her measures or counsels, or in order to put any force or constraint upon or in order to intimidate or overawe both Houses or either House of Parliament, or to move or stir any foreigner or stranger with force to invade the United Kingdom or any other of her Majesty's dominions or countries under the obeisance of her Majesty, and such compassings, imaginations, inventions, devices, or intentions, or any of them, shall express, utter, or declare, by publishing any printing or writing or by any overt act or deed, every person so offending shall be guilty of felony, and being convicted thereof shall be liable to be transported beyond the seas for the term or his or her natural life."