The U.S. government issued its first public defense of a law that restricts federal agencies from doing business with Huawei Technologies Co., saying it had ample national-security reasons for enacting it.

The law, signed last year by President Trump, put new limits on federal dollars going to Huawei and its Chinese rival, ZTE Corp. , and barred federal agencies from buying equipment that uses gear from the companies. Huawei first challenged the law in a lawsuit filed in Texas federal court in March.

The U.S. government’s defense of the law, articulated Wednesday in a legal filing responding to Huawei’s lawsuit, comes just days after President Trump raised the prospect of relaxing a U.S. campaign against Huawei by easing a Commerce Department blacklisting that limits the Chinese telecom giant’s ability to obtain U.S.-sourced technology.

The U.S. has long considered Huawei equipment a national-security risk, arguing that it could be used by Beijing to spy or disable telecom networks. Huawei, the world’s largest maker of telecom equipment and the No. 2 smartphone vendor, has long denied it would ever do so.

In its response to Huawei’s lawsuit, the U.S. hit back against the company’s argument that the provisions targeting it in the National Defense Authorization Act were unconstitutional. The U.S. said it has plenty of reasons to restrict Huawei’s business, pointing to years of government concerns regarding the safety of the company’s telecom equipment.