WASHINGTON (Reuters) - Defense Secretary Jim Mattis has spoken with U.S. President Donald Trump about the potential use of military funds for a border wall with Mexico, the Pentagon said on Thursday.

Trump, who last week got a fraction of the funding he wanted from Congress to fulfill a campaign promise by building the wall, suggested over the weekend that he might turn to the military for the money.

Mattis and Trump "have talked about the proposal, potentially, but, remember, securing Americans and securing the nation is of paramount importance to the secretary," Pentagon spokeswoman Dana White told reporters.

White did not provide any further details, but said these were "initial" conversations.

The $1.3 trillion spending bill passed approved by Congress last week contained $1.6 billion for six months of work on the wall. Trump had sought $25 billion for the project.

The president had threatened to veto the legislation, partly over the wall funding, but relented and signed it last Friday, saying a big increase in military spending had convinced him it was worthwhile.

Trump suggested getting funding for the wall from the military in a weekend Twitter post.

"Because of the $700 & $716 Billion Dollars gotten to rebuild our Military, many jobs are created and our Military is again rich," he wrote. "Building a great Border Wall, with drugs (poison) and enemy combatants pouring into our Country, is all about National Defense. Build WALL through M!," apparently using "M" as shorthand for "military."

Earlier this month, Trump toured the U.S. border with Mexico and examined eight styles of walls, prototypes for the barrier he promised to build to keep out illegal immigrants and drugs.

Building the wall was a main theme of Trump's 2016 presidential campaign. He said Mexico would pay for the wall, but the United States' southern neighbor has repeatedly said it would not.