A 31-year-old man was charged with terrorism after he threw a homemade bomb into a crowd of about 2,500 people protesting Australia Day in Perth last month. The bomb, filled with ball bearings and screws, failed to explode. Authorities said it could have caused a "mass casualty event". The man was already charged with an unlawful act intended to harm and making or possessing explosives under suspicious circumstances. The new terrorism charge carries a maximum penalty of life imprisonment. West Australian Premier Roger Cook said the attack on Aboriginal people and peaceful protesters was driven by a "hateful, racist ideology." He warned that if the bomb had exploded, it would have caused serious injuries or loss of life. Police Commissioner Col Blanch said the bomb had a lit fuse and "should have gone off." He added the man was "self-radicalised" and acted alone. Authorities had no prior warning of the attack. Federal Police Commissioner Krissy Barrett said detectives found the man had accessed "pro-white male, pro-white material online." The Australian Federal Police and the domestic intelligence agency ASIO joined the investigation 36 minutes after the attack. The man remains in custody and will next appear in Perth Magistrates Court on February 17.