Italy's parliament has passed a law making it compulsory to teach the national anthem in schools, angering the Northern League federalist party which has long campaigned against national symbols.

"Imposing something is a sign of weakness because it means that it is not felt in the hearts of the people," Northern League boss Roberto Maroni told the party's radio station Radio Padania on Friday after the law passed on Thursday.

The parliamentary vote marks a key setback for the Northern League.

Under the new law, Italian pupils will have to learn by heart and sing the anthem at school. They will also study the values of national unity.

The new law also appoints a national holiday to celebrate the unity of Italy in 1861, on March 17 each year.

The Northern League was the only party to vote against the new law, slamming it as "useless, rhetorical and totalitarian".

The anti-immigrant party, which was former prime minister Silvio Berlusconi's coalition ally, has been hit hard in the last few months by fraud scandals, and has slumped to less than six percent in the polls.