Sen. Lindsey Graham, a confidant of President Donald Trump, has floated a plan to tie money to build the president's proposed border wall to a critical increase in the U.S. debt ceiling.

If Trump takes that gamble to secure funding for the barrier that has so far eluded him, it would create a standoff with Democrats and stakes for the American and global economies much larger than the recent government shutdown. On Tuesday, the White House left the door open to Trump attaching the debt ceiling and border wall fights.

By tying the two issues together, Trump would hope Democrats would help him fulfill one of his key campaign promises out of an obligation not to cause economic harm. He may believe holding the possibility of a credit downgrade or default over the Democratic leaders would make them more likely to yield to his border wall demand.

The U.S. borrowing authority will run out in March if Congress does not raise the debt ceiling. While the Treasury can use so-called extraordinary measures to stop the government from running out of cash for a few months, failing to increase the borrowing limit could eventually lead to U.S. credit downgrades or even a default on loans.

On Tuesday, Graham told CNN that he spoke to Trump on Monday about how to strike a deal to keep the government running after the three-week stopgap spending expires on Feb. 15. The South Carolina Republican told the news outlet that he thinks "the president understands we need to raise the debt ceiling. It comes due in March, so why not just expedite things?"

Graham would not explicitly say whether Trump would insist on a debt ceiling increase as part of the immigration deal that lawmakers aim to strike before government funding expires.

"I don't speak for him," the senator told CNN. "I'm just saying, we talked about a package and I think the president basically believes that his priority of barrier funding can be achieved solving other problems also."

When asked whether Trump would consider tying the two issues together, a White House official left the door open to the possibility.

"The President has been clear that he wants to find lasting solutions to many issues including the crisis at our southern border," the official, who declined to be named, said in a statement.

If Trump insists on a debt limit increase as part of a deal, he would take a gambit on the health of the American economy. A default would cause cascading damage not only at home but also abroad. A 2011 U.S. credit rating downgrade caused stock market havoc.

"If this is tied to the debt ceiling into the summer, it does increase the pressure on markets over that time. It creates a lot of uncertainty," said Tom Simons, a money market economist at Jefferies.

Democratic congressional leaders have refused to approve the $5.7 billion Trump wants for the wall — forcing him to sign a bill to reopen the government Friday without money for the barrier.

Democrats would almost certainly oppose any plan to attach wall funding to the debt ceiling. The fact that current government funding expires on Feb. 15 — and the Treasury can likely use extraordinary measures to pay bills for a few months after the March deadline — gives Democrats less incentive to approve money for the wall.

Spokespeople for House Speaker Nancy Pelosi and Senate Minority Leader Chuck Schumer did not immediately respond to requests to comment on Graham's remarks.

Read the full CNN report here.

— CNBC's Patti Domm and Kevin Breuninger contributed to this report

Subscribe to CNBC on YouTube.