Sen. Lindsey Graham, who ran against President-elect Donald Trump in the Republican primaries and then refused to endorse him once he won the nomination, plans to defy Trump on immigration, saying he will introduce a bill that preserves President Barack Obama’s executive action blocking deportation of people who were brought to the United States illegally as children.

Graham, R-S.C., said he will offer a bill in the next Congress that will preserve the status quo for those covered by the Deferred Action for Childhood Arrivals program Obama created in 2012 through executive order. Trump promised to rescind all of Obama’s executive orders his first day in office.

House Democrats earlier this month urged Obama to pardon the estimated 750,000 DREAMers as a way of making sure they won’t face deportation.

"I'm going to introduce legislation with my Democratic colleagues and my Republican colleagues that would continue the legal status of the DACA kids," Graham told reporters Wednesday. "It's going to be basically if you have legal status today, you'll continue to have legal status."

The program grants work permits to people who arrived as children and blocks deportation if they meet certain requirements. Those participating in the program gave the federal government personal information, including their addresses.

Graham said he thinks Congress would pass an extension of the program “overwhelmingly.” Politico reported Sen. Jeff Flake, R-Ariz., is among those considering the legislation.

"If he [Trump] repeals it then we ought to immediately pass legislation to extend their legal status. I'm willing to do that," he said. "I'm going to support legislation that will continue legal status for these kids until we can find a fix to the overall program."

“The worst outcome is to repeal the legal status that these kids have. Whether you agree with them having it or not, they’ve come out of the shadows.”

Graham said the legislation is meant to be a stop-gap until Congress can enact overall immigration reform.

Trump initially pledged to deport all of the estimated 11 million people in the United States illegally but has since softened his stance, saying he would concentrate on criminals though he still planned to rescind Obama’s executive orders.

Graham was a member of the so-called Gang of Eight who wrote the Development, Relief and Education for Alien Minors Act, a wide-ranging immigration reform bill that was approved by the Senate but rejected by the House and gave rise to the label DREAMers to describe those covered by the measure.