He later said he looks "forward to VETOING the just passed Democrat inspired Resolution," thanking Republicans "who voted to support Border Security and our desperately needed WALL!"
This will mark the first veto of Trump's presidency.
Neither chamber is likely to have the votes to override the President. They would each need a two-thirds majority to override a block by the White House, and both parties say the numbers are not likely there.
In a subsequent tweet, Trump accused the Republicans who voted against him of standing with House Speaker Nancy Pelosi.
"It won't be overturned and the legal scholars say it's totally constitutional," Trump told reporters of his emergency.
Senator Mitt Romney, the 2008 Republican presidential nominee, was among the dozen Republicans who opposed Trump on the declaration, saying he cast his vote "for the constitution and for the balance of power that is at its core".
Meanwhile, Senator Thom Tillis of North Carolina initially said he would vote for the resolution blocking Trump, but changed his mind moments before the vote started.
"We have to recognise that we have a crisis at the border, 76,000 people crossing illegally in February alone. We have narcotics flooding our country, poisoning our children and adults of all ages," he said from the Senate floor.
At the White House, Trump did not answer when reporters asked if there would be consequences for Republicans who voted against him.
"I'm sure he will not be happy with my vote," said moderate Senator Susan Collins of Maine, who was among the 12. "But I'm a US senator and feel my job to stand up for the Constitution. So let the chips fall where they may."
Democrats solidly opposed Trump's declaration. Meanwhile, Trump and Republicans backing him said there was a legitimate security and humanitarian crisis at the border with Mexico.
They also said Trump was merely exercising his powers under the law, which largely leaves it to presidents to decide what a national emergency is.
The strongest chance of blocking Trump is in several legal challenges filed by Democratic state Attorneys-General, environmental groups and others.
Those cases could effectively block Trump from diverting extra money to barrier construction for months or longer.
- with AP