SHENZHEN, China - 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 federal district court in Texas, Huawei argued that a section of the 2019 National Defense Authorization Act passed into law in August, which prohibits federal agencies and contractors from buying Huawei equipment on national security grounds, unfairly punished the Chinese company without due process and without providing proof that Huawei posed 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 technological and commercial power.

In the past year, the United States has sought to persuade governments worldwide to shun Huawei equipment, indicted its employees for stealing American technology and sought the extradition of top executive Meng Wanzhou on fraud charges, deeply angering China's ruling Communist Party. U.S. officials and members of Congress have argued that Huawei is obliged to turn over data to the Chinese government under Chinese law and could be compelled to install hidden malicious code - an argument that formed the basis of the procurement ban written into the spending law's Section 889.

At a press conference Thursday with top executives and its U.S.-based lawyers, Huawei said the ban infringed on its rights and represented an instance of legislative overreach. The company cited a constitutional prohibition against Congress using its powers to target 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 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 targeting Huawei for punishment. Huawei's suit echoes that of the Russian cybersecurity firm Kaspersky Labs, which was similarly banned by Congress on fears it would help Moscow spy on the United States - and sought to overturn the ban with similar arguments.

Kaspersky has lost in both district and appellate court in the District of Columbia, with judges ruling that the bans were 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 meek responses to international criticism, Huawei's lawsuit is part of a significantly stepped-up 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 like rotating chairman Guo Ping scolded the United States for politicizing global technology standards while touting the bevy of non-Western telecom operators that have signed up to buy Huawei.

And Huawei Chief Financial Officer Meng Wanzhou 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, where she is wanted to face fraud charges in court.

The Chinese regime 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 announce next steps in their prosecution 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 leverage used by China against the Canadian government to free Meng.

Western governments have likened China's detention of the Canadians to hostage-taking, but their criticism has been undermined by statements by President Trump suggesting he could use the various criminal cases against Huawei as a bargaining chip to resolve unrelated trade disputes.

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 predicament 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. 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 U.S. businesses 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.