It said the US failed to provide evidence to support the ban, and the firm also rejected claims it had links to the Chinese government.
The US has restricted the use of Huawei products over national security concerns.
It has also been lobbying allies to shun the Chinese telecoms firm.
Huawei is one of the world’s largest telecommunications equipment and services providers.
The lawsuit is part of a wider push by the company in recent months to challenge claims its products pose security risks.
“The US Congress has repeatedly failed to produce any evidence to support its restrictions on Huawei products. We are compelled to take this legal action as a proper and last resort,” Huawei Rotating Chairman Guo Ping said in a statement.
“This ban not only is unlawful, but also restricts Huawei from engaging in fair competition, ultimately harming US consumers.”
Speaking at a press conference in Shenzhen, Mr Ping also accused the US government of misleading the public about Huawei and of hacking its servers.
Huawei’s cyber security chief John Suffolk said it was “the most open [and] transparent company in the world”.
But the company was later criticised for cutting the live feed of its conference before journalists could begin asking questions.
What does the lawsuit say?
Huawei is challenging the constitutionality of Section 889 of the National Defense Authorisation Act. The complaint has been filed in a US federal court in Texas.
Huawei also rejected claims it had any links to the state, saying in a statement the firm was “not owned, controlled, or influenced” by the Chinese government.
Several governments around the world, including Australia and New Zealand, have blocked telecoms companies from using Huawei gear in next-generation 5G mobile networks, citing security concerns.
Huawei strikes back
Analysis: John Sudworth, BBC News, Shenzhen
Huawei is beginning its fight back. It is not just the company’s reputation that is at stake, but perhaps the future of the global internet too.
The US argues that the political realities in China mean all companies are beholden to the will of the Chinese Communist Party which could use Huawei to spy on, or to disrupt, critical next generation mobile networks.
Huawei’s case is that there is no evidence that it has ever done anything to harm the interests of its consumers.
In the end, it may come down to how much latitude the courts decide the US Congress has in defining national security interests. The case, if it proceeds, could pass through a series of appeals and take many months.
As China continues to push out into the world, the big question is to what extent the unreformed system of Leninist control back home should be a concern.
What are the other points of contention?
In addition to restricting the purchase of Huawei products, the US is also pursuing criminal charges against the firm and its chief financial officer Meng Wanzhou.
Ms Meng, who is the daughter of Huawei’s founder Ren Zhengfei, was arrested in Canada in December, at the request of the US.
She was detained on suspicion of fraud and breaching US sanctions on Iran, and faces extradition to the US.
Last week, Ms Meng filed a civil claim against Canada’s government, border agency and police for “serious breaches” of her civil rights.
Mr Ren recently told the BBC that his daughter’s arrest was politically-motivated.
That possibility was also raised by Ms Meng’s lawyer in her scheduled court appearance in Vancouver on Wednesday.
US President Donald Trump said in December he could intervene in Ms Meng’s case if it helped to avoid a further decline in US relations with China.
How has Huawei reacted?
The lawsuit is part of a broader, more aggressive strategy by the Chinese tech giant to counter what it sees as an American “smear” campaign.
It has taken out ads in the foreign press and invited foreign journalists to visit its campuses as part of new public relations push.
In perhaps its most striking move, it appealed to the American public in a full-page ad in the Wall Street Journal, telling them not to “believe everything you hear.”