A 15-year-old boy is one of two people who were arrested and charged as part of an investigation into the alleged planning of a terrorist attack in Sydney, police say.

The teenager, from Georges Hall in Sydney's south-west, and a 20-year-old man from Raby were arrested at their homes on Thursday morning.

Each has been charged with one count of conspiracy to conduct an act in preparation for a terrorist act, the Australian Federal Police said.

Police will allege in court that the two were conspiring with three men who are already in custody to attack an Australian Federal Police building in Sydney.