Former spy denied legal aid in case over alleged bugging of East Timor government during negotiations on energy riches.

A former Australian spy charged with conspiring to reveal classified information to East Timor has been denied legal aid and might not be able to adequately fund his case, his lawyer told a court.

The spy, known as Witness K, was accused of conspiracy for his allegation that Australia bugged East Timor‘s government during negotiations over the sharing of billions of dollars in oil and gas.

The case was heard on Thursday in the Australian Capital Territory Magistrates Court on the eve of Prime Minister Scott Morrison flying to East Timor on Friday to begin a new revenue-sharing agreement for the seabed energy riches that separate the two neighbouring countries.

Witness K’s allegations that Australia bugged East Timorese Cabinet rooms in Dili in 2004 during treaty negotiations led to the impoverished half-island nation complaining to the Permanent Court of Arbitration in The Hague in 2013 that Australia had gained an unfair advantage.

The Timor Sea treaty signed in 2006 was scrapped and a replacement that was more generous to East Timor was signed in March last year.

Witness K’s lawyer Haydn Carmichael told Magistrate Glenn Theakston on Thursday that he and other lawyers were representing their client for free because he had been denied a request for legal aid more than a year ago.

Funding had been refused by the ACT Legal Aid Commission, which is government-funded but independent, despite the case being “an uncontestably complex matter and the first prosecution of its kind,” Carmichael said.

“For more than a year, countless hours have been committed pro bono to assisting Witness K,” Carmichael told the court.

But Witness K could soon need to make “significant disbursements” of money to call witnesses from around Australia and the world, the lawyer said.

Lawyers have said the witness intends to plead guilty, but they have yet to come to an an agreement with prosecutors on the facts of the crime, which carries a potential maximum two-year prison term.

That means a magistrate might have to hear witnesses’ testimony and judge the facts.

Theakston adjourned the case until September 13 when defence and prosecution lawyers will update him on progress in the agreement on the facts of the crime. They will also update the magistrate on progress in determining what evidence must be kept secret in the interests of Australia’s national security.

Carmichael has also foreshadowed an application for Legal Aid Chief Executive John Boersig to be subpoenaed to explain why Witness K had been denied legal funding.

East Timorese independence hero and the country’s chief negotiator on the Timor Sea treaty, Xanana Gusmao, told the Australian Broadcasting Corporation in a televised interview on Monday that he would like to testify in Canberra for Witness K and his coaccused Bernard Collaery.

Collaery, who had been Witness K’s lawyer, has pleaded not guilty to conspiring with the former spy to reveal secrets. Collaery is expected to face trial next year.

Gusmao, who has served as both his country’s prime minister and president, said he understood that Australia would drop both prosecutions after it agreed to the new treaty.

“My message is only an appeal [to Australia]. Please drop the issue. Please. Because I will always be on their side,” Gusmao said, referring to Collaery and Witness K.

Gusmao estimates that East Timor will gain an additional $5m a month in oil and gas revenue when the new treaty takes effect on Friday.

Attorney General Christian Porter this week stood by his government’s decision that both prosecutions were in the public interest.

Porter also said he was confident the courts would strike the right balance between the need to protect national security and the principle of transparent proceedings in deciding what evidence could be heard in an open court.