China's largely rubber-stamp parliament is considering tougher penalties for people who disrespect the national anthem or flag in public, including up to three years in jail, state news agency Xinhua said on Tuesday.

Xi Jinping has ushered in new legislation aimed at securing China from threats both within and outside its borders since taking over as president in 2013, as well as presiding over a sweeping crackdown on dissent and free speech.

China passed a new law in September mandating up to 15 days in police detention for those who mock the "March of the Volunteers" national anthem, a law that also covers the Chinese territories of Hong Kong and Macau.