A man has been charged with terrorism for allegedly throwing an explosive device at a crowd protesting the celebration of Australia Day in Perth last month.

The 31-year-old man was detained after hurling a homemade bomb into a throng of around 2,500 people who had gathered in support of the Aboriginal community.

The device, filled with ball bearings and screws, failed to explode, but authorities stated that it could have resulted in a mass casualty event.

Australia Day, held on January 26, commemorates the 1788 landing of Britain's First Fleet in Sydney Cove and is viewed by many Indigenous Australians as Invasion Day.

Police charged the man, whose identity has been suppressed for safety reasons, with committing an unlawful act with intent to harm and making or possessing explosives under suspicious circumstances.

West Australian Premier Roger Cook indicated that the attack was reportedly motivated by hateful, racist ideology.

“Thankfully, [the device] did not detonate, but without that, we could have seen a mass casualty event with injuries and potential loss of life,” Cook stated.

The terrorism charges carry a maximum penalty of life imprisonment and are a first for the state, according to law enforcement officials.

Cook acknowledged the deep impact of the incident on Indigenous communities across Australia and recognized the justified anger that has emerged.

West Australian Police Commissioner Col Blanch confirmed that the bomb had a lit fuse, asserting, It should have gone off.

Police had no prior intelligence of the attack and described the man as self-radicalised who acted alone. Investigators uncovered evidence that he had engaged with pro-white material online.

The Australian Federal Police, in coordination with the domestic intelligence agency, Asio, was brought in shortly after the explosion attempt to assess any ongoing threats.

The suspect, currently in custody, is scheduled to appear in Perth Magistrates Court on February 17.