FILE- This Nov. 9, 2018, file photo shows a Walmart Supercenter in Houston. Walmart agreed Thursday, June 20, 2019, to pay $282 million to settle civil and criminal allegations of overseas corruption, including payment through a Brazilian subsidiary of more than $500,000 to an intermediary known as a

ALEXANDRIA, Va. (AP) — Walmart agreed Thursday to pay $282 million to settle federal allegations of overseas corruption, including funneling more than $500,000 to an intermediary in Brazil who was known as a "sorceress" for her uncanny ability to make construction permit problems disappear.

U.S. authorities went after Walmart under the Foreign Corrupt Practices Act, which prohibits American companies operating abroad from using bribery and other illegal methods.

The nation's biggest store chain settled both civil charges brought by the Securities and Exchange Commission and a criminal case built by federal prosecutors in Virginia. It said the two settlements close the books on federal investigations that stretch back to 2012 and have collectively cost the company more than $900 million.

"We're pleased to resolve this matter," said Walmart President and CEO Doug McMillon in a statement. "Walmart is committed to doing business the right way, and that means acting ethically everywhere we operate. We've enhanced our policies, procedures and systems and invested tremendous resources globally into ethics and compliance, and now have a strong Global Anti-Corruption Compliance Program."

In the criminal case, Walmart agreed to pay $138 million to avoid prosecution, while its Brazilian subsidiary, WMT Brasilia, pleaded guilty to violating the Foreign Corrupt Practices Act. As for the civil case, the SEC announced a $144 million settlement against Walmart for "failing to operate a sufficient anti-corruption compliance program" in Brazil, China, India and Mexico.

"Walmart valued international growth and cost-cutting over compliance," said Charles Cain, chief of the SEC unit overseeing FCPA violations. "The company could have avoided many of these problems, but instead Walmart repeatedly failed to take red flags seriously and delayed the implementation of appropriate internal accounting controls."

The criminal case focused on corruption that occurred in Brazil in 2009 and 2010 and involved what authorities said were misdeeds by the subsidiary that led the parent company to submit inaccurate financial records.

The money that went to the intermediary was recorded as payments to a construction company, even though there were numerous red flags indicating the intermediary was actually a government official, authorities said. Walmart Brazil was barred at the time from hiring civil servants.

Court papers do not identify the intermediary but say she became known inside Walmart Brazil as a "sorceress" or "genie" for her "ability to acquire permits quickly by 'sort(ing) things out like magic.'"

A representative of Walmart Brazil had no comment.

Walmart's foreign practices have been under investigation since 2012. The New York Times won a Pulitzer Prize for reporting that year that exposed millions of dollars in bribes made by Walmart executives to facilitate growth in Mexico.

According to the SEC, companies including Halliburton, Anheuser-Busch InBev, JPMorgan and Panasonic reached settlements under the Foreign Corrupt Practices Act ranging from $6 million to $264 million in recent years. Last year a Brazilian energy company agreed to pay nearly $1.8 billion.

Bentonville, Arkansas-based Walmart recently reported quarterly earnings of $3.84 billion. It announced last year that it decided to sell 80% of its stake in Walmart Brazil to Advent International at a loss of $4.5 billion. At the time, the subsidiary had 438 stores in Brazil.

___

AP Correspondent Yesica Fisch in Rio de Janeiro and AP Business Writer Marcy Gordon in Washington contributed to this story.