A suspected petrol bomb has detonated outside an Islamic centre in the city of Perth, Australia, as hundreds of worshippers attended an evening prayer service inside.

The explosion outside the Thornlie Mosque on Tuesday night caused no injuries but damaged four vehicles, one of which was completely gutted by the fire, police said. 

Anti-Islamic graffiti was later found spray-painted on a wall associated with an Islamic college that was part of the centre.

Prime Minister Malcolm Turnbull condemned the attack, saying Australia had a fundamental foundation of mutual respect.

"I deplore and I cannot condemn strongly enough any attacks of that kind," he told radio station 6PR.

"It is believed an accelerant was used to start the fire," Western Australia police said in a statement, adding that an investigation was under way.

"The Perth community was visited this evening by hate," Yahya Adel Ibrahim, a teacher at the Islamic college, wrote on Facebook.

"This, undoubtedly, is a criminal act of hate, but it is the act of a person or group, not the greater whole," he said, noting that worshippers remained at the mosque to finish their prayers.

Chris Tallentine, the area's local member of parliament, visited the site and said: "I feel sick that you have to endure attacks like this. The truth is that this was an attack on all of us."

At the last national census in 2011, Muslims made up less fewer than three percent of the overall Australian population of 24 million, with the overwhelming majority of the country identifying as Christian.

Source: Agencies