Two men and a teenager have pleaded guilty to plotting a terrorist attack on government buildings, including police headquarters, in Sydney almost three years ago.

Jibryl Almaouie, 23, and Sulayman Khalid, 22, pleaded guilty in the NSW Supreme Court in Parramatta on Monday to conspiring to carry out an act of terror in late 2014.

Another person under 18, who cannot be named, also pleaded guilty to the plan, which involved carrying out the attacks with firearms.

The two men and the teen who pleaded guilty on Monday are among six involved in the plot.