Indonesia has defended the executions of Australians Andrew Chan and Myuran Sukumaran, saying although the death penalty is not "pleasant" it is vital in the war against drugs.

Space to play or pause, M to mute, left and right arrows to seek, up and down arrows for volume. Listen Duration: 5 minutes 24 seconds 5 m Listen to George Roberts's report. Download 9.9 MB

Indonesian attorney-general Muhammad Prasetyo confirmed Chan and Sukumaran, along with four Africans and a Brazilian, were executed simultaneously at 3:35am (AEST) on Wednesday, each by a 13-man firing squad.

Mr Prasetyo said medical teams confirmed their deaths three minutes later.

"All shots were done perfectly. These executions were carried out smoothly and in order — much better than the first round of executions in January," he said.

News agency AFP reported the condemned prisoners all refused blindfolds and sang hymns, among them Amazing Grace, before being killed in a jungle clearing, according to a pastor who was with them.

The executions happened despite consistent appeals from the Australian Government and a final appeal from family members last night.

"We are fighting a war against horrible drug crimes that threaten our nation's survival," Mr Prasetyo told reporters in Cilacap, across from the high-security prison island of Nusakambangan where the executions took place.

"I would like to say that an execution is not a pleasant thing. It is not a fun job.

"But we must do it in order to save the nation from the danger of drugs.

"We are not making enemies of counties from where those executed came. What we are fighting against is drug-related crimes."

President Joko Widodo, who has been a vocal supporter of the death penalty for drug traffickers, also defended the executions: "This is our rule of law, the rule of law concerning the death penalty.

Space to play or pause, M to mute, left and right arrows to seek, up and down arrows for volume. Watch Duration: 9 minutes 12 seconds 9 m Bali 9 pair's execution 'dark moment' in Australia-Indonesia relationship

"We also respect the laws of other countries."

Chan and Sukumaran's bodies have been taken to Jakarta, where they will remain until they are returned to Australia at the end of the week.

Filipina Mary Jane Veloso was also set to be executed but was given an eleventh hour reprieve after her cousin turned herself in to Philippine authorities, admitting responsibility for the drugs found in the young woman's luggage.

"She was asked to give testimony to uncover cases of human trafficking," Mr Prasetyo said.

"This has led to postponement of the execution of Mary Jane, because we respect the legal process that is being implemented in the Philippines."

Mr Prasetyo played down Australia's withdrawal of ambassador Paul Grigson, describing it as a "temporary reaction".

He pointed out that the Netherlands and Brazil took the same measure after their citizens were executed in January.

Diplomat's withdrawal likely to backfire, Indonesian analyst says

One of Australia's top Indonesia analysts and a close watcher of Mr Widodo said the Australian Government's diplomatic action was likely to backfire.

Aaron Connolly, a research fellow in the East Asia Program at the Lowy Institute, said it was unfortunate Mr Abbott chose to withdraw the ambassador to express Australia's displeasure.

"The ball is really in their court. I'm not sure that they anticipated that Australia would react the way that it did," he told The World Today.

"From their perspective this was not a foreign policy issue, it was an issue of carrying out a sentence laid down by their courts.

"So I suspect they will react badly and unfortunately, I think those views will collide over the coming days."

Mr Connolly said there was a range of other options available to the Government.

"They could have reduced the number of ministerial visits, particularly with characters that we understand are problematic and pushing Indonesia backwards as opposed to forwards," he said.

"There have been suggestions that the Australian Government should look at suspending aid to Indonesia, suspending cooperation in areas such as security and policing, with future federal police cooperation contingent on the death penalty not applying."

But Mr Connolly said that would be a mistake.

Analysts warn Tony Abbott's decision to withdraw Australia's ambassador to Indonesia will harm his relationship with Indonesian president Joko Widodo. ( Twitter: @TonyAbbottMHR )

In withdrawing the ambassador, Mr Connolly said Mr Abbott clearly signalled that the relationship with Indonesia was important.

"I think the Prime Minister's tone ... was the right tone but in terms of the relationship, Indonesians certainly believe that Australia needs Indonesia more that Indonesia needs Australia," he said.

"The Australian Embassy in Jakarta really did absolutely everything that it could, but the fact is this is something Jokowi, president Joko Widodo, was determined to do [and] many of us didn't pick up on that."

Mr Connolly said he doubted Mr Widodo would become more lenient on issues like the death penalty.

"In terms of relationships with other countries, Jokowi has said that he wants a better relationship with Australia but he's also said that he believes Australia doesn't always respect Indonesian dignity," he said.

"And certainly the Prime Minister's comments on February 18th, when he said that the tsunami aid should be reciprocated in some way by goodwill from Indonesia, that was interpreted very badly in Jakarta as an affront to Indonesian dignity, as though that $1 billion in aid could buy special dispensation for Australians in the Indonesian legal system.

"So that really complicated things, but I think it is possible that if both governments are careful about how they behave in the next few months, if we in Australia take an attitude that this was a real tragedy and don't act in anger but act in sadness, I think it's possible that we can get to a better place with Indonesia."