Australian state governments have agreed to change laws so they can keep high-risk people convicted under terrorism laws in prison after they have served their sentences.

State and territory attorneys-general said at a meeting at Parliament House on Friday that they had in-principle given support to a federal plan of indefinite detention for convicted terrorists who are likely to reoffend.

The new laws could apply to 13 prisoners who are serving lengthy sentences in Australian prisons for federal terrorism offenses after several plots were thwarted in Sydney and Melbourne. Several of them have openly voiced support for extremist groups, including the Islamic State group.

The laws could also apply to another 36 suspects who are awaiting trial on serious terrorism charges.