President Donald Trump talks with a U.S. Customs and Border Protection (CBP) Border Patrol Agent while participating in a tour of U.S.-Mexico border wall prototypes near the Otay Mesa Port of Entry in San Diego, California, March 13, 2018.

President Donald Trump has privately said his proposed wall on the U.S.-Mexico border should be funded through the United States military, The Washington Post reported Tuesday.

The president made the suggestion to "several advisors" and House Speaker Paul Ryan last week, the newspaper said, citing three people familiar with a meeting between Trump and Ryan. Trump thinks the Defense Department could bankroll the barrier, a key campaign proposal for the president, because immigration poses a national security risk, the Post reported.

A congressional source familiar with the matter told CNBC the Washington Post report is accurate.

The president signed a $1.3 trillion spending bill that included a massive military funding increase last week, despite his unhappiness with the amount of money it put toward border security. Trump wanted as much as $25 billion for his wall project, but the legislation authorized only $1.6 billion for fencing, surveillance technology and other measures.

Congress would likely need to redirect money from the current Defense budget to the wall project, which is unlikely to happen, according to the Post report. As a candidate, Trump repeatedly promised Mexico would fund the wall, but he has backed off those pledges in office, seeking federal money.

Asked Tuesday how specifically Trump would get Mexico to pay for the wall, White House press secretary Sarah Huckabee Sanders said, "When we have an announcement on that, I'll let you know."

The story also clears up a cryptic piece of a tweet the president sent early Sunday. Trump wrote that "building a great Border Wall, with drugs (poison) and enemy combatants pouring into our Country, is all about National Defense. Build WALL through M!"

"M" references the military, according to the Post.

The White House's military office and the Pentagon did not immediately respond to requests for comment.

Read the newspaper's full story here.