The Save the Children charity says hackers stole nearly $1 million from the nonprofit through a sophisticated email scam.

The Boston Globe reports that scammers hacked into the email of a worker at the Fairfield, Connecticut-based charity last year, posed as an employee, and created false invoices and other documents to fool the charity into sending nearly $1 million to a fraudulent entity in Japan.

Related Content: Stretch Your Dollar: Fighting credit card fraud

The scammers claimed the money was needed to purchase solar panels for health centers in Pakistan, a country where Save the Children has worked for decades.

The Save the Children Federation, the U.S. affiliate of the international relief organization, said its insurance reimbursed all but $112,000 of the stolen funds.

The charity has since tightened its cybersecurity and bank transfer protocols to prevent fraud.