Donald Trump declared the national emergency under a 1976 law (File Photo)

President Donald Trump expressed confidence on Tuesday that he would prevail against a lawsuit filed by 16 U.S. states seeking to block his declaration of a national emergency to fund a wall along the U.S. border with Mexico.

The group of states, including California and New York, has charged the president and top officials in his administration with taking away taxpayer funds for their communities to fulfil a promise from his 2016 campaign to curb illegal immigration and the flow of drugs.

Trump's remarks to reporters in the Oval Office suggested he was not concerned or surprised by the states' legal challenge.

"I think, in the end, we're going to be very successful with the lawsuit," Trump said. "It's an open-and-closed case."

The American Civil Liberties Union on Tuesday filed its own lawsuit in a U.S. District Court in California, alleging that "Trump disregarded the will of Congress with his emergency declaration."

Legal experts have said challenges to Trump's emergency declaration, which critics have called unconstitutional, face an uphill and probably losing battle in a showdown likely to be decided by the conservative-majority U.S. Supreme Court.

Trump declared the national emergency under a 1976 law after Congress declined to give him the $5.7 billion he wanted to build parts of the barrier this year.

The president's demand for wall funding triggered a historic 35-day government shutdown that ended in January. Democrats and Republicans later agreed on a deal to avoid another shutdown with $1.4 billion allocated toward border fencing. Trump agreed to sign that and then declared a national emergency, redirecting an additional $6.7 billion beyond what lawmakers authorized for the project.

California, Colorado, Connecticut, Delaware, Hawaii, Illinois, Maine, Maryland, Minnesota, Nevada, New Jersey, New Mexico, New York, Oregon, Virginia and Michigan joined forces for the lawsuit.

The states said Trump's order would cause them to lose millions of dollars in federal funding for National Guard units dealing with counter-drug activities and that redirection of funds from authorized military construction projects would damage their economies.

Texas landowners and an environmental group also filed suit against the move.

Trump predicted the legal challenges when he made the announcement in the White House Rose Garden last week, and he defended his right to make the declaration on Tuesday.

"We need strong borders. We have to stop drugs and crime and criminals and human trafficking. And we have to stop all of those things that a strong wall will stop," he said.

House of Representatives Speaker Nancy Pelosi, the country's top Democrat, has called a wall immoral. The issue is likely to be a flashpoint in the 2020 presidential campaign, just as it was when Trump, a Republican, ran for president in 2016.

The ACLU suit, filed on behalf of the Sierra Club and the Southern Border Communities Coalition, said that in addition to diverting taxpayer money from other federal projects, Trump's barrier would affect "ecologically sensitive habitats" and disturb wilderness areas along the border.