Several hundred Australian nationalists and anti-racism activists clashed with police in Melbourne in a rare display of violence in the country.

Police used pepper spray to try to keep the two sides apart after the anti-racism activists attempted to keep the nationalists from holding their "Reclaim Australia" rally.

Prime Minister Tony Abbott made blocking migrants trying to reach Australia by boat a key plank of his election campaign in 2013.

Fear of young Australian Muslims being inspired by armed groups and travelling to fight in Iraq and Syria has underpinned support for right-wing groups like Reclaim Australia and the United Patriots Front.

"The message is very clear: you come here, embrace our way of life," Daniel Nalliah, National President of the Rise Up Australia Party and organiser of the Reclaim Australia rally, told the crowd.

"If you think where you come from is better than where you are coming to, shut up, pack up and get out."

About 450 police were on hand following violent clashes at a similar rally earlier this year, and officers used pepper spray as they struggled to keep the two sides apart.

Four people were arrested in Melbourne, Victoria state police said. At a similar rally in Adelaide, police made one arrest, local media reported. There were no reports of injuries.

More than a dozen Reclaim Australia rallies are scheduled around the country on Sunday, including one at which a member of Abbott's government will speak in Queensland state.

National Party MP George Christensen wrote on his Facebook page that he wanted "to support people who seek to defend our Australian way of life, our culture and our freedoms from the threat of radical Islam".

Source: Agencies