NEW YORK (AP) — Walmart filed a motion on Monday to dismiss a lawsuit by the Federal Trade Commission in June that accused the nation’s largest retailer of allowing its money transfer services to be used by scam artists, calling it an “egregious instance of agency overreach.”

In its lawsuit, the FTC alleged that for years, Walmart failed to properly secure the money transfer services offered at its stores, stealing “hundreds of millions of dollars” from customers. The agency said Walmart didn’t properly train its employees, failed to alert customers, and used procedures that allowed fraudsters to cash out at its stores. The FTC had asked the court to order Walmart to return money to consumers and to impose civil penalties on the company.

In a 41-page document, filed in U.S. District Court for the Northern District of Illinois Eastern Division, Walmart laid out a number of what it called legally flawed claims, including that the agency lacked “constitutionally valid authority to sue for money or injunctive relief.” It said that the FTC is trying to hold Walmart liable for the criminal actions of completely unrelated third-party fraudsters even as Walmart has embraced a number of steps to stop such scamming.

Walmart argued that the agency is trying to contort a regulation called the Telemarketing Sales Rule that was aimed to go after telemarketers and those who actively help them but that Walmart is neither. Walmart also took issue with the FTC’s claim that Walmart allegedly engaged in an “unfair” act or practice, or any ongoing or imminent misconduct under Section 5 of the FTC Act.

“To be clear, Walmart is now—and always has been—dedicated to its customers and shares the FTC’s goal of protecting customers from fraudsters,” the Walmart filing said. “But this lawsuit is an egregious instance of agency overreach.”

Walmart stores let shoppers to transfer money using three providers — MoneyGram, Ria Financial Services, and Western Union Co.

Walmart, based in Bentonville, Arkansas, said it has developed and implemented a host of anti-fraud measures—including customer warnings and employee trainings. Based on data available to Walmart, out of nearly 200 million money-transfer transactions processed at its U.S. namesake stores between 2015 and 2020, less than 0.08% were reportedly the product of fraud, according to the Walmart filing. And it said that some of that reported fraud may not be fraud at all, making the actual fraud rate even smaller.

In its argument by Walmart that the FTC overreached in its authority, Walmart cited a April 2021 Supreme Court case that makes it difficult for the agency to engage in a long-time practice of seeking to recover ill-gotten gains from individuals or companies that steal from consumers. As a result of the ruling, the agency will now have to rely on other lengthier and more complicated legal maneuvers to recoup dollars from defrauded individuals.

FTC officials couldn’t be immediately reached for comment.