ASUNCION, July 29 (Xinhua) -- Paraguay's Foreign Minister Luis Alberto Castiglioni, and its ambassador to Brazil Hugo Saguier Caballero resigned on Monday in the wake of the fallout from a secret energy deal with Brazil.

Paraguay's President Mario Abdo Benitez accepted their resignation amid public outcries over the bilateral agreement that was reached in May but only made public recently, after parts of the deal were leaked last week.

The energy purchase agreement centered on the Itaipu hydroelectric plant which straddles the two countries, and had been criticized as harmful and costly for Paraguay.

Two other officials -- the Paraguayan Director of Itaipu Binacional Jose Alberto Alderete and President of the National Electricity Administration (ANDE) Alcides Jimenez -- have also resigned. Jimenez was just recently appointed to the job.

ANDE's former President Pedro Ferreira had quit in protest of the agreement.

The bilateral accord, which established Paraguay's purchasing timeline from Itaipu through 2022, was signed on May 24 and never officially made public.

Following the scandal, Castiglioni said on Sunday that the government would ask Brazil to nullify the agreement.

"I regret that this misunderstanding has led to such a state of discontent. Everything we did was transparent and for the benefit of the country," Castiglioni said via Twitter.

He and the others who resigned said they would appear before the congress to explain their actions.

Government spokesman Hernan Huttemann said the president will announce his new appointments later in the week.