Australia's foreign minister says a deal has been reached with Indonesia to end a row over claims Australian agents spied on the Indonesian president.

Julie Bishop told the ABC that a "joint understanding" had been reached and preparations to sign it were under way.

Intelligence sharing and military and border co-operation would resume when the pact was signed, reports said.

The spying claims came from documents leaked by Edward Snowden. Indonesia briefly withdrew its ambassador.

The allegations were first reported in Australian media in November 2013.

'Hurtful action'

The alleged spying took place in 2009 under the previous Australian government.

The leaked documents showed that Australian spy agencies named Indonesia President Susilo Bambang Yudhoyono, the first lady, the vice-president and other senior ministers as targets for telephone monitoring, Australian media said.

The revelations followed other reports saying Australia's embassy in Jakarta was used as part of a US-led spying network in Asia.

Indonesia reacted angrily to the claims, with Mr Yudhoyono saying ties had been damaged by Australia's "hurtful action".

He then suspended co-operation on operations to stop people-smuggling, joint military exercises and intelligence exchange.

Ms Bishop told Fairfax Media that the deal - exact details of which have not been released - was a "concise statement of our commitment to respect each other's sovereignty".

"This means we will not be using our intelligence resources to harm Indonesia's interests," she was quoted as saying.

Presidential spokesman on foreign affairs Teuku Faizasyah told the BBC that Indonesia and Australia had reached a common understanding.

He said Mr Yudhoyono - who leaves office in October when new leader Joko Widodo takes power - hoped the deal would give the incoming government a strong foundation to heal the bilateral rift.

"[The] code of conduct is an important component for both countries to rebuild trust and confidence, where there will be no abuse of technology from the country with more advanced technology that could harm their friendly neighbour," he said.

Source: BBC