In the International Court of Justice this week, as lawyers from Australia and East Timor traded barbs and legal argument in equal measure, the emotions have been raw.

There is plenty at stake. Billions of dollars in oil revenue for starters, and the standing of Australia as a good citizen and global moral force. Throw in multiple allegations of spying and dirty dealing, and the ICJ's imposing court and 16-strong panel of judges have rarely seen drama like it.

At issue is the unprecedented seizure by the Australian Security Intelligence Organisation last month of the tiny country's legal documents and the confiscation of the passport of its star witness, a decorated former officer of the Australian Secret Intelligence Service.

The raids, says counsel for East Timor, were ''unconscionable'', the theft of another nation state's property to manipulate an international arbitration over a $40 billion oil and gas treaty.

Its lead counsel Sir Elihu Lauterpacht, the octogenarian eminence grise of international legal scholarship, said it was no different to the annexation of Timorese territory. ''There is no difference between the taking of territory and the taking of property … a taking is a taking,'' he said, adding that Timor was ''much poorer'' than its neighbour.

Australia's lawyers told the court they were ''wounded'' by East Timor's assertions and Attorney-General George Brandis ''offended'', firing back by accusing East Timor of risking the lives of its spies.

''The sniping by both sides has been pretty extraordinary,'' says Ben Saul, a professor of international law at the University of Sydney.

East Timor is demanding the legal documents, laptops and USB stick seized in the ASIO raids on a former Australian Secret Intelligence Service agent and the Canberra office of East Timor's lawyer Bernard Collaery be sealed and handed over to the ICJ. It wants the material then returned to it, and any copies destroyed.

Moreover, Australia must ''give an assurance that it will not intercept or cause or request the interception of communications between Timor-Leste and its legal advisers, whether within or outside Australia or Timor-Leste''.

This final extraordinary demand flows from the revelation of the former ASIS officer, reputedly the head of its technical operations, that Australia installed listening devices and microphones in the walls of East Timor's government offices in 2004.

The bugging operation occurred during negotiations for the oil and gas treaty that is the subject of the international arbitration that has been under way in The Hague for several months.

The alleged espionage underpins East Timor's entire case that the treaty - the Treaty on Certain Maritime Arrangements in the Timor Sea or CMATS - should be declared invalid.

CMATS divides the revenue from the Greater Sunrise field 50-50, even though the resources are closer to East Timor than Australia.

The fight over the resources is, ultimately, what this dispute between East Timor and Australia is about.

The hearing at the ICJ is about the ASIO raids themselves, and Australia's case relies on convincing the court the legal documents and data obtained in the ASIO swoop are not protected by international law in the way diplomatic correspondence and embassies are.

To claim they should be treated the same, as East Timor does, would fundamentally expand the concept of sovereignty, Australia argues.

It contends the revelations by the ASIS agent were a clear and serious breach of its national security laws. A classified operation had been disclosed to a foreign state, Australia's spy trade craft exposed and its intelligence officers put at risk.

And the information passed on by the agent, which includes a written affidavit, was owned by it, not East Timor, and was no different to the documents taken by National Security Agency whistleblower Edward Snowden from the US.

''If Edward Snowden flees America containing information in documents that he has stolen, and if he gives that information to a foreign state or to a media outlet, that would not deprive the United States of ownership in those materials,'' Australia's Solicitor-General Justin Gleeson said.

Brandis has given multiple undertakings to the ICJ, some drafted in the middle of proceedings, promising that no one on the Australian side involved in either the ICJ hearing or the arbitration would have access to the documents.

He even gave an unusual personal undertaking not to read the material himself. Whether these undertakings are enough clearly exercised the judges, who asked pointed questions about how they would be enforced.

The timing of the raids was also the subject of scrutiny because it goes to the heart of Australia's case that they were driven by national security concerns rather than thwarting East Timor in the arbitration proceedings.

The raids, on December 3, came two days before a hearing in the arbitral tribunal. Yet Australia had known that the allegations of the ASIS bugging operation had been passed on to Timor for more than a year. The details had become public in May, more than six months before the raids.

Gleeson maintained there was no link between the timing of the ASIO swoop and the arbitration, but revealed Australia planned to block the former spy giving evidence before the tribunal, which, like the ICJ, is in The Hague.

It appears contradictory, even more so given the man's passport was cancelled and Australia feared he was going overseas ''within days''.

''I do not need to remind the court of other instances of which we are aware publicly of persons who have fled their country with dangerous information they should not have taken with them for exposure and when it is then too late to act,'' he said.

It was another reference to Snowden, and also a reminder that the ICJ will consider its verdict amid widespread suspicions around the world about the overreach of intelligence agencies.

If it rejects East Timor's application, the ICJ could set a precedent that sanctions spy agencies seizing documents and data from other nations with which they are in dispute.

By accepting East Timor's position, it may have implications for states that assert the right to protect the disclosure of classified information, a provision in most countries' national security laws.

The panel of ICJ judges has much to consider and is expected to hand down a provisional verdict within six weeks. A final ruling is likely to take a year or more.