Huawei said Thursday that it has sued the U.S. government to challenge a law that bans federal agencies from buying its telecommunications equipment, opening a new front in the metastasizing global contest between the Chinese technology giant and Washington.

In a lawsuit filed in U.S. District Court in Texas, Huawei argued that a section of the 2019 National Defense Authorization Act that prohibits federal agencies and contractors from buying Huawei equipment on national security grounds unfairly punishes the Chinese company. The lawsuit asserts that the prohibition was imposed without due process and with no proof provided that Huawei poses an espionage threat to the United States.

The complaint adds a new subplot — in American courts — to the sprawling standoff between the Trump administration and a tech firm seen as an icon of China’s rise into a world power.

The lawsuit comes as decades-old Chinese policies locking out American companies — from the financial to automotive to Internet sectors — lie at the heart of the current bilateral trade dispute.

In the past year, the United States has sought to persuade governments worldwide to shun Huawei equipment, indicted employees of the company on charges of stealing American technology and is seeking the extradition of Chief Financial Officer Meng Wanzhou — held in Canada on a U.S. warrant — on fraud charges, deeply angering China’s ruling Communist Party. U.S. officials and members of Congress have argued that Huawei is obligated to turn over data to the Chinese government under Chinese law and could be compelled to install hidden malicious code in equipment that it sells to U.S. buyers — an argument that formed the basis of the procurement ban written into the recent defense spending law.

At a news conference Thursday with top executives and its U.S.-based lawyers, Huawei said the ban infringed on its rights and was an instance of legislative overreach. The company cited a constitutional prohibition against Congress’s using its powers to single out individuals for “punishment” and said it was the target of precisely that: an unfair effort by lawmakers including Sens. Tom Cotton (R-Ark.) and Marco Rubio (R-Fla.) to stigmatize it as beholden to the Chinese Communist Party and to put it out of business.

“Huawei has never had a fair chance to confront or cross-examine its accusers,” Huawei Chief Legal Officer Song Liuping told reporters. “The U.S. Congress has acted as lawmaker, prosecutor and juror all at the same time, contrary to the U.S. Constitution.”

Julian Ku, a professor of constitutional law at Hofstra University, said U.S. courts may not be swayed by the argument that Congress was unfairly targeting Huawei. Huawei’s suit echoes that of the Russian cybersecurity firm Kaspersky Labs, which was similarly banned by Congress on fears that it would help Moscow spy on the United States — and sought to overturn the ban with similar arguments.

Kaspersky has lost in district and appellate courts in the District of Columbia, with judges ruling that the bans were national-defense-minded and not punitive in nature.

Federal judges will also have to consider whether the ban violates Huawei’s fundamental rights, Ku said, but “doing business with the U.S. government doesn’t seem to be a fundamental right, and there are reasonable grounds for Congress to act against Huawei.”

After years of relatively measured responses to international criticism, Huawei’s lawsuit is part of a muscular public relations and legal counteroffensive in recent months. Its reclusive billionaire founder, Ren Zhengfei, has broken years of silence to address foreign media, and this month the company invited U.S.-based reporters to tour its Shenzhen headquarters, all-expenses paid.

At a global industry conference last month, executives such as Guo Ping, who currently holds the rotating chairmanship, accused the United States of politicizing global technology standards and touted the bevy of non-Western telecom operators that have signed up to buy Huawei’s technology.

And Meng, the Huawei executive held in Canada, sued the Canadian government last week, alleging violation of her civil rights shortly after Canada approved a hearing for her extradition to the United States.

The Chinese government also appeared to push back forcefully Monday, when the Communist Party’s top judicial and law enforcement body announced grave espionage accusations against two Canadians, Michael Kovrig and Michael Spavor, but did not indicate its next prosecutorial steps or formal charges.

The detention of the two Canadians, who have been held in secret locations and harsh conditions since December, has widely been seen by diplomats in Beijing and in Ottawa and Washington as China’s applying extraordinary leverage against the Canadian government on Meng’s behalf — and further evidence of the ties between Huawei and the Chinese state.

At the same time, the U.S. government’s attempts to portray its pursuit of Huawei and Meng as law enforcement actions unaffected by any political considerations have also been undermined by statements from President Trump suggesting that he could assist Huawei against his own Department of Justice if Beijing would make a favorable trade deal with the United States.

Song, the Huawei chief legal officer, declined Thursday to say whether the Chinese government’s moves against the detained Canadians in apparent retaliation for Meng’s arrest had inflamed or dispelled the perception that his company is closely tied to the government.

“Our cases, and Ms. Meng’s case, and the cases in China are independent, they’re separate,” he said. “We hope Canada, its courts, will give Ms. Meng a fair trial, and we hope she’ll come back soon.”

Told by reporters that many American firms feel they have been unfairly locked out of the Chinese market for years without recourse — one of the complaints lodged by the United States in the current trade dispute — Song called China a country “governed by the rule of law” and encouraged those companies to take their complaints to Chinese courts.

“They should take legal action to protect their rights like we protect our rights in the United States,” he said.