Australia's prime minister says he is "devastated" by scenes of violent clashes between police and protesters in Sydney during a demonstration against the Israeli president's visit.

"These are scenes that I think shouldn't be taking place," Anthony Albanese told local media on Tuesday.

His comments came hours after police arrested 27 people at a mass rally in Sydney on Monday night. Earlier, rally organisers had failed in their court bid to overturn police powers that limited their right to demonstrate.

Albanese stood by his decision to invite Isaac Herzog to Australia after the Bondi shootings, saying it would help the Jewish community heal, despite objections from pro-Palestinian groups.

Fifteen people, including a ten-year-old girl, were killed on 14 December after two gunmen shot at crowds at a event celebrating the Jewish festival of Hannukah.