SYDNEY (Reuters) - Australian police have arrested and charged a teenager with planning a terror attack on Monday’s commemorations of the ANZAC landings at Gallipoli during World War One, which attracted thousands of people in Sydney.

The 16-year-old boy was arrested near his Sydney home on Sunday and appeared before a children’s court on Monday. Court documents show that police accuse the boy of attempting to obtain a gun, Australian Associated Press reported.

The case was adjourned until Tuesday, AAP said, and the boy cannot be named because of his age. The terrorism offence carries a maximum penalty of life imprisonment.

New South Wales state Police Commissioner Andrew Scipione said police believed the boy was acting alone. “We have taken swift action to ensure community safety on the eve of a sacred day on the Australian calendar,” said Scipione.

ANZAC Day, April 25, is a major annual holiday in Australia and New Zealand marking the first major battle involving troops from both countries during World War One at Gallipoli in Turkey.

Despite the campaign’s failure against Ottoman Turkish forces, with the loss of more than 11,000 ANZAC lives, it has come to be viewed as a formative moment of national identity in both Australia and New Zealand, and is now a day of remembrance for military dead from both nations in all subsequent conflicts.

Dawn services and military parades were held around Australia and New Zealand, with the largest drawing tens of thousands of people in Sydney and Melbourne.

At Sydney’s Bondi Beach, Australian Prime Minister Malcolm Turnbull joined more than 5,000 people at a beachside dawn ceremony.

“We choose to stand as one in a moment of silent contemplation, in tribute to those who fought and died so that we could live in freedom,” Turnbull said later at a ceremony at the Australian War Memorial in the capital, Canberra.

Several teenagers have been arrested in Australia in recent years and charged with terrorism offences, including five young men who police alleged were planning an attack at last year’s centenary ANZAC day celebrations in Melbourne.

Police said those planning the attack last year clearly took inspiration from the Islamic State movement, also known as the Islamic State in Iraq and Syria, or ISIS.