A Turkish court has rejected Australia’s request for the extradition of Islamic State suspect Neil Prakash, in a setback for Canberra’s efforts to prosecute him at home.

Prakash’s lawyer Mehmet Alper Unver said on Thursday Prakash could be freed from Turkish custody if the court ascertained he was not under investigation for other crimes.

The court in the town of Kilis, near the Syrian border, said Prakash must stay behind bars for now to answer local terrorism charges, News Corp reported.

Unver said the prosecution, which argued for Prakash’s extradition, also had the right to appeal against the verdict.

The decision not to extradite Prakash will come as a shock to Australian authorities. Australia had been pressing Turkey to extradite Prakash since he was first detained there nearly two years ago. In May the prime minister, Malcolm Turnbull, said he expected Prakash to be extradited imminently.

The suspected Isis recruiter has been in custody near the border with Syria since 2016, after he attempted to enter Turkey with false documents.

The former rapper from Melbourne has been linked to several Australia-based attack plans and has featured prominently in propaganda videos exhorting Australians to join Isis. The Australian government has alleged that Prakash actively recruited Australian men, women and children and encouraged acts of militancy.

Prakash was believed to have been killed during a US-led attack on Mosul in 2016, but subsequently found alive and arrested.

He faces a potential life sentence if convicted in Australia of terrorism offences.

In a statement on Friday, the Australian foreign affairs minister, Julie Bishop said: “We are disappointed that the Kilis criminal court in Turkey has rejected the request to extradite Neil Prakash to Australia.

“We will continue to engage with Turkish authorities as they consider whether to appeal the extradition decision.”

A spokesman at Turkey’s foreign ministry in Istanbul had no immediate comment and the Turkish embassy in Australia did not respond immediately to a request for comment.

Ties between Turkey and its allies fighting Isis, particularly the United States, have been frayed by Washington’s support for the Syrian Kurdish YPG militia, which Ankara regards as a militant group.

Canberra announced financial sanctions against Prakash in 2015, including anyone giving him financial assistance, with punishment of up to 10 years in jail.

Australia raised its national terror threat level to “high” for the first time in 2015, citing the likelihood of attacks by Australians radicalised in Iraq or Syria.

Australia believes more than 100 of its citizens were fighting in the region.