Sen. Marco Rubio said a national-emergency declaration by President Donald Trump over border security could hurt Republicans in the future.

Rubio said congressional Republicans "have to be careful about endorsing broad uses of executive power."

The Florida lawmaker warned that a declaration on border security could set a precedent that, in the future, might embolden a Democratic president to declare a national emergency over other issues, such as climate change.

Republican Sen. Marco Rubio of Florida warned President Donald Trump against declaring a national emergency over border funding, saying it could set a precedent that could be dangerous for Republicans in the future.

"If today, the national emergency is border security ... tomorrow the national emergency might be climate change," Rubio said Wednesday during an interview on CNBC's "Squawk Box".

Rubio said he is in favor of "anything that makes the border more secure," but he doesn't believe the president should declare a national emergency right now.

The US is on day 20 of the government shutdown, which began when Trump refused to accept any spending bill that didn't include $5.7 billion in border-wall funding.

Read more: Trump's threat of a national-emergency declaration to fund the border wall is leaving Capitol Hill in shock

Rubio told CNBC that Trump has to keep his "promise" of building a border wall, given that his base would be disappointed if he didn't comply.

During the last few days, the president has been floating around the idea of declaring a national emergency over what he has called a "border crisis," which would allow him to skip Congress' approval for wall funding and use the military to build it.

Rubio said Republicans should be "careful about endorsing broad uses of executive power," adding that he's "not prepared to endorse [a national-emergency declaration] right now."

President Donald Trump gives an address on border security from the Oval Office. Carlos Barria-Pool/Getty Images

"For people on my side of the aisle, one of the concerns we should have is if today the national emergency is border security, and it entitles him to go out and do something — we all support that," Rubio said. "Tomorrow. the national-security emergency might be climate change, so let's seize the fossil-fuel plants or something. Maybe it's an exaggeration, but my point is we've got to be very careful about endorsing broad uses of executive power."

It is unclear whether the president has considered Rubio's warning. On Thursday, the president tweeted that he "maybe definitely" might declare a national emergency over border security. As he headed to the border on Thursday, Trump told reporters he has "the absolute right to declare an emergency."

"I haven't done it yet," he said. "I may do it if this doesn’t work out. I probably will do it."

US presidents have declared 58 national emergencies since 1979, according to the Brennan Center for Justice's count. George W. Bush declared one after 9/11, as did Barack Obama during the swine flu outbreak in 2009.