Image copyright AFP Image caption The bodies of the executed prisoners have been returned to their families for funerals

UN Secretary-General Ban Ki-moon has expressed "deep regret" over Indonesia's execution of eight people convicted of drug offences.

The seven foreigners and one Indonesian were executed by firing squad on Wednesday, sparking diplomatic fury.

In a statement, Mr Ban said the death penalty had "no place in the 21st Century" and urged Indonesia to spare all other death row prisoners.

Indonesia has staunchly defended its actions as part of its "war on drugs".

"Execution is not a pleasant thing. It is not a fun job," Indonesian Attorney General Prasetyo said on Wednesday.

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

Among the executed prisoners were two Australian men - Andrew Chan and Myuran Sukumaran - and Brazilian Rodrigo Gularte, all convicted of drug smuggling.

Australia, a key ally of Indonesia, has recalled its ambassador in protest.

Mr Abbott on Wednesday described the treatment of the Australians as "cruel and unnecessary", calling it a "dark moment" in Australia's relationship with Indonesia.

"We respect Indonesia's sovereignty but we do deplore what's been done and this cannot be simply business as usual," he said.

Who were the condemned prisoners?

Image copyright various

Australians Myuran Sukumaran and Andrew Chan

Indonesian Zainal Abidin bin Mgs Mahmud Badarudin

Nigerians Raheem Agbaje Salami, Sylvester Obiekwe Nwolise, Okwudili Oyatanze and Martin Anderson (originally reported to be Ghanaian)

Brazilian Rodrigo Gularte

Frenchman Serge Areski Atlaoui and Filipina Mary Jane Fiesta Veloso were spared as they have ongoing appeals

The woman saved at the eleventh hour

Joko Widodo stands firm against 'war on drugs'

Brazil said the execution of Gularte - who had been diagnosed with severe mental illness - was "a serious event in the relations between the two countries".

He was the second Brazilian to be executed for drug smuggling in Indonesia in four months. A priest who was with Gularte as he went to the firing squad has told the media he did not appear to understand he was about to die.

Nigeria also expressed "deep disappointment" at the execution of four of its nationals, one of whom was originally reported to be from Ghana.

Image copyright AP Image caption The woman Veloso accuses of planting drugs on her reported to police on Tuesday

There were celebrations in the Philippines, however, after a Filipina woman was spared at the last minute.

Mary Jane Veloso's execution was postponed after the Indonesian government agreed to let her testify in the case of the woman she has accused of planting heroin in her luggage.

Maria Kristina Sergio turned herself in to the police unexpectedly this week and has been taken to the capital, Manila, for investigations.

A French man, Serge Areski Atlaoui, remains on death row. He has an outstanding legal complaint over his request for clemency.

France has said it is "fully mobilised" on his case.

Indonesia has some of the toughest drug laws in the world and ended a four-year moratorium on executions in 2013.

It says it takes a hard line because of the country's own drugs problem - 33 Indonesians die every day as a result of drugs, according to Indonesia's National Narcotics Agency.