A landmark agreement to be signed in New York tomorrow (AEDT) will close the door on the long and bitter dispute between Australia and East Timor over their maritime boundary.

But it could lead to a new legal wrangle for Australia if Indonesia tries to use the deal to renegotiate its own outdated boundaries with Australia.

In a worst-case scenario for Australia — if that were to happen — it could allow Indonesia to claim its own rights to lucrative oil and gas reserves in the Timor Sea.

History of Timor Sea treaties In 1989 Australia and Indonesia signed the Timor Gap Treaty when East Timor was still under Indonesian occupation.

In 1989 Australia and Indonesia signed the Timor Gap Treaty when East Timor was still under Indonesian occupation. East Timor was left with no permanent maritime border and Indonesia and Australia got to share the wealth in what was known as the Timor Gap.

East Timor was left with no permanent maritime border and Indonesia and Australia got to share the wealth in what was known as the Timor Gap. In 2002 East Timor gained independence and the Timor Sea Treaty was signed, but no permanent maritime border was negotiated.

In 2002 East Timor gained independence and the Timor Sea Treaty was signed, but no permanent maritime border was negotiated. East Timor has long argued the border should sit halfway between it and Australia, placing most of the Greater Sunrise oil and gas field in their territory.

East Timor has long argued the border should sit halfway between it and Australia, placing most of the Greater Sunrise oil and gas field in their territory. In 2004 East Timor started negotiating with Australia again about the border.

In 2004 East Timor started negotiating with Australia again about the border. In 2006 the CMATS treaty was signed, but no permanent border was set, and instead it ruled that revenue from the Greater Sunrise oil and gas field would be split evenly between the two countries.

The new maritime treaty — to be signed at United Nations headquarters — will draw a permanent boundary between Australia and East Timor for the first time, and set down a formula for sharing billions of dollars in future oil and gas revenues from the Timor Sea.

Details of the agreement have been kept secret until now. But it is expected to include a boundary at the median line — or midway point — between the two countries, which is a long way south of the boundary Australia had long proposed — at the edge of its continental shelf which extends to within 50 nautical miles of East Timor's south coast.

The treaty is crucial for East Timor's economic future, given its over-reliance on other dwindling petroleum royalties, and because a median line boundary would likely give the tiny nation sovereignty over more of the lucrative Greater Sunrise oil and gas field, which estimates suggest could be worth up to $50 billion in value.

Questions about Australian-Indonesian border

However, a median-line boundary between Australia and East Timor could have implications for Australia's far longer boundaries with neighbouring Indonesia, if not now then down the track.

It's a prospect that successive Australian governments have sought to avoid.

Indeed, in 2002 — the year East Timor gained independence — Australia's then foreign minister Alexander Downer warned that redrawing the maritime boundaries with East Timor would risk "unravelling" thousands of kilometres of boundaries Australia had long ago settled with Indonesia.

"What Australia doesn't want is to unravel all of our maritime boundaries which have been laboriously negotiated over many years with all our neighbours," he said at the time.

"Our maritime boundaries with Indonesia cover several thousand kilometres. That is a very, very big issue for us and we are not in the game of renegotiating them."

East Timorese Prime Minister Mari Alkatiri. ( ABC TV )

Now, 16 years on, that scenario may not be so far-fetched.

You only have to look at a map of Australia's maritime boundaries with Indonesia and East Timor, to see the potential problem. Putting the boundary with East Timor at the midway point would introduce a dog leg with the adjoining boundaries with Indonesia.

Australia's seabed boundaries with Indonesia were settled as early as 1971, when most of Australia's maritime boundaries were based on the continental shelf, which again extends well beyond the median line and ends close to the Indonesian coastline.

But international law has changed since then and today favours the median line, and not the continental shelf.

The 1982 UN Convention on the Law of the Sea stipulates that "where the coasts of two states are opposite or adjacent to each other, neither of the two states is entitled … to extend its territorial sea beyond the median line."

Door open for Indonesian gas access

That means if the maritime boundaries with Indonesia were negotiated today, they'd look completely different and give Indonesia far greater rights to the seabed.

Crucially, it would arguably give Indonesia rights to a share of the Greater Sunrise field.

Even in 1977 — five years after the boundaries were negotiated — Indonesia's then foreign minister Mochtar Kusamaatmadja claimed that Australia had "taken Indonesia to the cleaners" over the boundary negotiations.

Accordingly, the median line was later used to determine Indonesia's Exclusive Economic Zone in a separate treaty in 1997, such that Indonesia's fishing rights today extend much further south than its rights to the seabed (oil and gas).

The Australian and Indonesian governments may need to renegotiate their maritime border. ( ABC News: David Spicer )

In fact, Indonesia has never ratified the 1997 treaty, although it has honoured it.

But international law expert Don Rothwell, from the Australian National University, believed that decision leaves the door open to Indonesia to seek to renegotiate its own boundaries with Australia, in the same way that East Timor has successfully done.

"Because Indonesia has yet to ratify [the treaty] it gives Indonesia the option to come back to Australia and say we'd like to revisit particular aspects of that treaty, especially in light of the final maritime boundary arrangements you have now entered into with East Timor," Professor Rothwell said.

"That could open up for Australia quite a significant can of worms in terms of facing the prospect of renegotiating a significant swag of our maritime boundary arrangements with Indonesia, which stretch from West Timor right out alongside the boundary with Java and into the Indian Ocean."

Australia could face challenge to negotiate

Most contentious of all are the so-called "lateral" boundaries that run perpendicular to the median line between Australia and East Timor.

The Greater Sunrise field straddles the eastern lateral boundary, very close to the existing Australia-Indonesia boundary. If Indonesia chose to pursue the issue there could be significant implications for Australia's maritime sovereignty, and the rights to Greater Sunrise.

"I think that [Indonesia] would be saying look, Australia has been prepared to effectively redraw these boundaries with East Timor," Professor Rothwell said.

"If Australia has been prepared to renegotiate some of those boundaries with East Timor why can't Australia renegotiate the boundaries with Indonesia that were settled some time ago also?

"Which would then create some considerable complexity because then you'd be looking at a three-way negotiation on how that particular area of the seabed should be carved up."

International law expert Don Rothwell believes Indonesia may seek to negotiate its border with Australia. ( ABC News Breakfast )

Professor Rothwell said Australia had no doubt kept Indonesian officials abreast of its ongoing boundary negotiations with East Timor, to avoid such an outcome.

But he said Indonesian officials until now have not been prepared to go on the record in terms of how they might react to the new boundary arrangements in the Timor Sea, once they're revealed.

"Having said that there is a general principle in international law that boundaries should be respected, and not be redrawn," he said.

"And that treaties, once they're concluded, should be accepted. States are bound by treaties in good faith."

Good faith is one thing but billions of dollars in untapped oil and gas reserves is quite another.

The ABC sought comment from the Indonesian Government and maritime experts, but had not yet received a response.