Photographs of executed drug convicts are displayed at a hospital morgue in Jakarta on April 29, 2015 during a prayer session

Indonesia faced a storm of international protest Wednesday for putting seven foreign drug convicts before a firing squad, but Filipinos rejoiced after a compatriot was spared at the last minute.

Australia withdrew its ambassador in protest at what it called "cruel and unnecessary" executions, Brazil expressed strong regret and France vowed a diplomatic battle to save a citizen still on death row.

Indonesia staunchly defended the executions as a vital front of its "war" on drugs, as testimony emerged of how the condemned men went singing to their deaths.

The seven -- two from Australia, one from Brazil and four from Nigeria -- were shot along with one Indonesian, despite strident foreign appeals and pleas from family members.

Brazil expressed "deep regret" at the execution of its national, who was mentally ill according to his family, and said it was weighing its next move.

Abuja on Wednesday named the Nigerians put to death as Martin Anderson, Okwudili Oyatanze, Jamiu Abashin and Sylvester Obiekwe, and expressed its "deep disappointment" over Jakarta's decision.

There had been confusion about the names and nationalities of the four Africans, with Nigeria's National Drug Law Enforcement Agency (NDLEA) saying last week that Anderson was Ghanaian.

The condemned men reportedly all refused blindfolds and sang hymns, among them "Amazing Grace", as they went to face the firing squad in a jungle clearing, according to a pastor who was with them.

As the clock ticked down to midnight, a group of tearful supporters also sang hymns, embraced and held candles aloft during a vigil at the port in Cilacap, the gateway to the prison island of Nusakambangan.

A Filipina originally set to be executed was given an 11th hour reprieve after a woman who allegedly duped her into ferrying drugs to Indonesia came forward to police in the Philippines.

The reprieve for Mary Jane Veloso was hailed in the Philippines as a miracle and a gift from God, but Indonesian Attorney General Muhammad Prasetyo stressed it was only a "postponement" to allow time for police investigations.

He added: "We are fighting a war against horrible drug crimes that threaten our nation's survival.

"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 countries from where those executed came. What we are fighting against is drug-related crimes."

- 'They asked for mercy: there was none' -

Prasetyo also played down Australia's decision to recall its ambassador, describing it as a "temporary reaction", while Foreign Minister Retno Marsudi stressed Jakarta's desire to "continue having good relations" with one of its most important trading partners.

Australians Andrew Chan and Myuran Sukumaran, ringleaders of the so-called "Bali Nine" heroin trafficking gang, were described by Canberra as reformed men after years in prison.

The families said their sons did "all they could to make amends, helping many others" since their arrests, with Sukumaran teaching fellow inmates English and art, and Chan ordained as a minister in February.

"They asked for mercy, but there was none," the families said in a joint statement.

Nigeria's President Goodluck Jonathan and Foreign Minister Aminu Wali said in a statement they had made "spirited appeals for clemency", for the lives of their four nationals, most recently at an Asian-African summit in the Indonesian capital Jakarta last week.

There were already signs of fallout Wednesday with former Indonesian president Susilo Bambang Yudhoyono cancelling a trip to Perth, citing concern about reaction to the executions.

The European Union meanwhile expressed its "dismay" and called for a moratorium on further executions in the country. United Nations Secretary General Ban Ki-moon echoed the sentiment, saying the death penalty "has no place in the 21st century".

Jakarta stocks closed down 2.34 percent, due in part to the effect of the death sentences on investor sentiment.

- Plain coffins -

Widodo, who took office in October, cites figures from the national anti-narcotics agency showing that more than 30 Indonesians die every day due to drugs.

However some academics believe the agency's data is flawed, while critics accuse Widodo of pursuing a populist policy following recent political problems.

Story continues