A man has been charged with terrorism after he allegedly threw 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, which was filled with ball bearings and screws, failed to explode, but authorities said it could have turned into a "mass casualty event".

Australia Day - a national holiday on 26 January - marks the 1788 landing of Britain's First Fleet in Sydney Cove and the start of colonisation. For many Indigenous Australians and their supporters, it is known as Invasion Day.

Police had already charged the man - whose identity has been suppressed by the courts for his safety - with committing an unlawful act with intent to harm and one count of making or possessing explosives under suspicious circumstances.