By Jan Wolfe

(Reuters) – Huawei Technologies Co Ltd has opened up a new front in its battle with the U.S. government by filing a lawsuit challenging a congressional ban on federal agencies’ use of the Chinese technology company’s products.

Legal experts said the firm is likely to lose its case because U.S. courts tend to avoid second-guessing Congress’ actions relating to national security, including the ban enacted in August as part of a defence spending bill.

But some lawyers said that Huawei might be hoping to score public relations points against the U.S. government even if it knows its chances of winning are slim.

The following explains the measures against Huawei, the nature of the lawsuit, and why it will likely be dismissed.

What is Huawei and why is it at odds with the U.S. government?

Shenzhen-based Huawei is the world’s biggest producer of telecommunications network equipment and it also competes with Apple Inc and Samsung Electronics Co as a smartphone maker.

The company and its founder Ren Zhengfei have long been suspected of having close ties with China’s military and intelligence agencies.

Huawei denies that it works with the Chinese government and that its products are designed to facilitate spying.

Separately from the legislation at issue in the lawsuit, the United States is also considering a ban on the use of Huawei telecom equipment by U.S. companies in the construction of 5G wireless networks, and is urging its allies to do the same.

Washington has also accused Huawei of stealing trade secrets and violating U.S. sanctions on Iran. Chief financial officer Meng Wanzhou, who is also Ren’s daughter, was arrested in December in Canada at the request of the U.S. Justice Department, which claims she orchestrated the violations.

Huawei says the U.S. actions are politically motivated, coming at the same time as the Trump administration is holding high-stakes trade negotiations with Beijing. U.S. demands include that China change its laws and practices to protect intellectual property and end forced transfers of technology to Chinese firms.

What is Huawei’s complaint?

Huawei’s primary argument is that the ban on its products is a “bill of attainder” – a legislative act condemning a particular person or group of people and punishing them without a trial.

Bills of attainders are specifically banned in the U.S. Constitution.

In one of the most well-known cases involving a bill of attainder, a unanimous U.S. Supreme Court in 1946 struck down as unconstitutional an act of Congress that stripped three government employees of their salaries for allegedly supporting “subversive activities.”

More recently, a federal judge ruled a North Carolina bill limiting funding to the women’s health organisation Planned Parenthood was an unconstitutional bill of attainder because it was “adopted specifically to penalise” the group.

Huawei is also alleging a violation of its due process rights, and argues that Congress violated the constitutional principle of separation of powers by exercising authority reserved for the judicial system.

Does Huawei have a case?

Most U.S. legal experts say no, since ruling for Huawei would likely require the courts to decide there was no legitimate basis for Congress’ inclusion of the ban in its bill.

In general, U.S. courts are reluctant to second-guess national security determinations by Congress and the executive branch, who are viewed as being in a better position to make such decisions.

Several legal experts pointed to a November 2018 decision by a federal appeals court rejecting a similar bill of attainder claim by Russian cybersecurity firm Kaspersky Lab, whose anti-virus software was banned from U.S. government networks by legislation in 2017.

The court in that case said national security concerns about Kaspersky were supported by “ample evidence” and that it needed to give Congress “latitude” to craft measures to protect national security.

The Texas court hearing Huawei’s case will not be bound by that decision, but will certainly consider its reasoning closely because of the similarities in the two disputes.

Why would Huawei bring a lawsuit it is unlikely to win?

Huawei may figure the potential benefits in terms of public opinion are worth a legal fight, no matter what the outcome. The firm has launched a massive public relations offensive over the past two months.

If Huawei’s case survives a motion to dismiss, the Chinese company would be allowed to demand discovery from the U.S. government, including documents and possibly the testimony of officials.

Those documents could provide evidence for its position that Washington is motivated more by politics than any real national security concerns.

But legal experts said Huawei faces long odds getting past a motion to dismiss, noting the Kaspersky case was thrown out before discovery. The centralized nature of the Chinese government, with its close ties to industry, and the many well-documented cases of Chinese hacking would all support the position that the U.S. law has a reasonable basis.

Some legal experts said a case involving a wind energy company owned by Chinese nationals might offer Huawei a slender hope for precedent.

Ralls Corp sued after the Obama administration moved in 2012 to block it from building wind turbines close to a military site in Oregon on natural security grounds. A federal court ruled the government violated Ralls’ due process rights by not giving it an opportunity to rebut the unclassified evidence the government relied upon to reach its decision.

The case was resolved in 2015 in a confidential settlement, after which Ralls sold the wind farms.

(Reporting by Jan Wolfe; Editing by Anthony Lin and Sonya Hepinstall)