Indonesia's attorney general on Wednesday defended the execution of seven foreign drug convicts, saying that the country was facing a "war" against drugs.

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

The seven convicts -- two from Australia, one from Brazil and four from Africa -- were put to death by firing squad early Wednesday, along with one Indonesian, despite strident international appeals and pleas from family members.

READ ALSO: Indonesia executes foreign drug convicts, defying global anger

A Filipino originally set to be executed was given an 11th hour reprieve.

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

"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."

He also played down Australia's decision to recall its ambassador over the execution of its citizens, describing it as a "temporary reaction".