A Muslim man who was part of a group seeking to “kill as many unbelievers as they can and impose Sharia law” used the Boston Marathon terror attack as his model, an Australian court has heard.

The claim was made during sentencing proceedings for Tamim Khaja, 20, who pleaded guilty in October to planning and preparing a terrorist attack two years ago.

The then 18-year-old was arrested while readying for a massacre, either at the U.S. embassy in Sydney, an Army barracks or at a court complex. It’s alleged Khaja is close to imprisoned Islamic extremists Milad bin Ahmad-Shah al-Ahmadzai and his brother, Maywand Osman, who are also in custody on terrorism offences.

Video evidence was shown of Khaja appearing expressionless as he talks about murdering innocent people, ABC News reports.

He told undercover officers he was planning “maximum fire.”

“I mean to take as many of them down as I can. I’m not going to stop firing… If there’s like a two month old baby, or someone holding a baby, I’m just trying to think if that’s true, I wouldn’t buckle in that situation.”

Khaja started planning the terror attack after a failed attempt to travel to Syria to fight with Islamic State in 2016.

He wrote to an unidentified man: “I am so sad I couldn’t come. My heart has been broken. I wanted so badly to be on the battlefield with my brothers.

“I am thinking more along the lines of Boston Marathon… I know how to make a portable microwave b..b [sic]… Even with a handgun I would be able to cause a lot of damage.”

He said instead he would fulfil his “obligation” in Australia, telling the person he was sourcing a glock pistol but was arrested later that month by NSW Police.

Counsel for the defendant, Ian Temby QC, tendered to the court a list of recent sentences handed down to other men who had been convicted of terror offences.

In response, Justice Fagan told the court that Australia had “been under attack for 15 years by about 40 Muslim men, to kill as many unbelievers as they can and impose Sharia law.”

The trial comes in the wake of the pre-Christmas terror attack in Melbourne where the Afghan refugee responsible “attributed his actions to perceived mistreatment of Muslims.”