The case against one of the country’s major terrorism targets has collapsed with charges withdrawn after he spent more than 18 months in Goulburn’s Supermax prison.

Maywand Osman, 22, has been a central target of Operation Appleby, a three-year state and federal investigation into domestic terrorism plots.

He was alleged to have been part of a group of western Sydney extremists intent on carrying out Islamic State-inspired terrorist attacks.

He was detained but not charged during the first sweeping Appleby raids in September 2014, prompted by an alleged plot to behead a person at random on the streets of Sydney.

He was later charged in December 2014 over an alleged plot to attack police and government buildings including the Garden Island naval base and Australian Federal Police headquarters.

Eight males, including a 15-year-old boy, have been charged over the partially formed plot that was allegedly uncovered in handwritten notes found in the Regents Park home of Sulayman Khalid in 2014.

Fairfax Media understands much of the case hinges around their involvement in writing the notes.

Charges against Mr Osman were withdrawn in Central Local Court on Wednesday, the court hearing there was not enough evidence to proceed.

His lawyer, Moustafa Kheir, said outside court that his client had been kept in “horrific, subhuman conditions” in Supermax.

He will make an application for the police to pay Mr Osman’s legal costs.

“Understandably, both he and his family are extremely relieved that this nightmare is finally over,” Mr Kheir said.

“I will be pursuing every legal avenue available to my client to help remedy this injustice.”

Of the other seven men still facing charges over the alleged plot, six will have a two-day committal hearing in late July.

On Wednesday, Mr Khalid waived his right to a committal hearing.

Mr Osman will remain in prison until he has served time on an unrelated matter.

Mr Kheir said there was a state of hysteria and fear around national security matters and appropriate measures need to be implemented to avoid “over-policing”.