Beijing (AFP) - China has passed legislation to punish anyone who disrespects the national anthem with up to three years in prison, state media reported Saturday.

The changes to China's criminal law were approved during a committee meeting of the country's rubberstamp parliament, the National People's Congress (NPC), according to the official Xinhua news agency.

"Serious cases of disrespecting the country's national anthem in public would get punishments including deprivation of political rights, criminal detention, and imprisonment of up to three years," it said.

China has been fine-tuning legislation on the proper way and place to sing its national anthem, recently tightening rules that already bar people from performing it at parties, weddings and funerals.

The country in September passed a National Anthem Law applying to mainland citizens, which specified a much lesser jail term of 15 days for disrespecting the song.

Xinhua said the three-year sentence could apply in "serious" cases concerning disrespect towards the anthem, but did not provide further details.

According to the National Anthem Law, "The March of the Volunteers" can no longer be played as background music in public places and "inappropriate" private performances of the song are also forbidden.

Separately on Saturday, Hong Kong's government said that law will also apply in the semi-autonomous territory, once the authorities enact a local version of the legislation and get it passed through the legislature.

Hong Kong football fans have booed the anthem when it is played at matches for years, as concerns grow about the city's liberties coming under threat.

Pro-Beijing politician Ip Kwok-him said, "when this law is passed, people must stand, there must be a display of solemnity."

Ip, a Hong Kong deputy to the NPC, told a radio programme on Saturday that people in the city would have to stop when they heard the anthem even if they were walking.

"I've personally experienced this in Bangkok, when walking on a pedestrian bridge, all of a sudden I heard a song, all the people on the bridge stopped. I had to stop too after I saw this," he said.

Story continues

Written in 1935 before the Communist Party took power and officially adopted in 1982, the buoyant, military-minded score calls on the Chinese people to "march on" toward the establishment of a new nation.

The September law follows regulations on national anthem etiquette that were announced in 2014 to "enhance the song's role in cultivating core socialist values".

An ideological push has intensified in China since President Xi Jinping took power in 2012. He has stressed a drive to infuse every aspect of Chinese education with "patriotic spirit" in a campaign to strengthen the party's legitimacy -- but which critics condemn as little more than brainwashing.

Before Xi, China had laws covering the use of its national flag and national emblem but none for its anthem, aside from a ban on its use in advertisements.