The Australian Government has been told to stop spying on East Timor.

Australia was given the order by the International Court of Justice after a bitter dispute formed between the governments of the two nations.

The case was launched after revelations that Australia had been spying on East Timor and its legal advisers during an inter-governmental stoush over $40 billion of oil and gas reserves in the Timor Sea.

The ICJ also ruled that the Australian government must lock up documents and data seized during an ASIO raid last December.

As the United Nations' top court, the ICJ and its decisions are binding for all members.

Australia’s Attorney-General George Brandis ordered the raid on East Timor's Australian lawyer Bernard Collaery, which saw federal agents hit the office and take piles of legal documents, electronic files and a statement by a former Australian Secret Intelligence Service agent claiming Australia had been spying on the tiny island nation.

East Timorese representatives say the country still suspects the ASIO raid was just a small part of a large-scale espionage campaign against it. The Government says it wants to have the treaty between the two countries over the Timor Sea reserves declared invalid, as it was not negotiated in good faith.

That accusation will be tested before an international arbitration tribunal in the Hague.

“Australia shall not interfere in any way in communications between Timor Leste and its legal advisers in connection with the pending arbitration under the Timor Sea Treaty of 20 May 2002 between Timor Leste and Australia; with any future bilateral negotiations concerning maritime delimitation; or with any other related procedure between the two states, including the present case before the court,'” ICJ president Peter Tomka said.

The ruling is a provisional measure until the broader case before the ICJ is concluded, the arbitration in the Hague and the dispute over the Greater Sunrise deposit included.

Senator Brandis said in a statement that the court’s order would be complied with, but made no mention of the order to stop spying, noting only that the ICJ declined East Timor's request for its documents to be returned.

The ruling was supported by 15 of the ICJ's panel of judges; the only one opposed was judge Ian Callinan, the former Australian High Court judge appointed to the panel by Senator Brandis.

“It's a sad day when our country gets an order like this,” Mr Collaery  has told Fairfax Media outlets.

“It's a sad day when Australia needs to be reminded of the proper standards of behaviour regarding litigation.”

The ICJ’s ruling said that while undertakings by the Australian government not to look at the now-sealed documents were good, it was difficult to assume they would be totally adhered to.

“The court finds that there remains a risk of disclosure of this potentially highly prejudicial information'', one ICJ judge said.

“In spite of the written undertaking [by Senator Brandis] dated 21st January 2014, there is still an imminent risk of irreparable prejudice.”

The court found the material “contains sensitive and confidential information [relating] to the pending arbitration and it may also include elements that are pertinent to any future maritime negotiations which may take place between the parties”.

“Australia shall ensure that the content of the seized material is not in any way or at any time used by any person or persons to the disadvantage of Timor-Leste until the present case [before the ICJ] has been concluded,” it said.”

“It also decides . . . that Australia shall keep under seal the seized documents and electronic data and any copies thereof until further decision of the Court.”