Republican Sen. Rick Scott told CNBC on Thursday that lawmakers should create a path for young undocumented immigrants brought to the U.S. as children to remain in the country legally.

"Why don't we make sure they have a path to say here?" the Florida senator asked during a "Squawk Box" interview, discussing so-called Dreamers. "We have a lot of people here from other countries under a temporary protective program. Why don't we have a permanent solution for that?"

Lawmakers have long sought a solution to protect the immigrants and made it more of a priority when President Donald Trump tried to end the Obama-era Deferred Action for Childhood Arrivals in 2017.

The issue of immigration became more heated last year, when the Trump administration began separating immigrant children from their parents at the U.S. border as part of a "zero tolerance" policy. Trump formally ended the policy, but some immigration advocates say children are still being separated.

"You shouldn't separate kids from parents," said Scott. He said laws should be changed to prevent family separations.

Citing a poll that says around 60 percent of Hispanics in his state want stricter immigration enforcement, Scott said lawmakers have been all talk for too long. "Florida is an immigration state," the former two-term governor said. "We all want security."

Scott appeared on CNBC as lawmakers on Capitol Hill got ready to vote on a border security compromise to prevent another partial government shutdown. A stalemate in December over Trump's request for $5.7 billion to build 215 miles of wall on the U.S.-Mexico border led to a record-long 35-day government shutdown.

Congress on Thursday aimed to end a dispute with legislation that includes nearly $1.4 billion for 55 miles of new physical barriers but not a concrete wall. The president remains uncommitted to signing an agreement ahead of a midnight Friday deadline, although he has said he doesn't want another shutdown.

Scott predicted that Trump will end up signing the bill.