The Department of Defense "has no legal authority" to use appropriated funds for President Donald Trump's border wall between the U.S. and Mexico, two Democratic senators wrote in a letter to Defense Secretary James Mattis.

"Until we can have a wall and proper security we're going to be guarding our border with the military," Trump said Monday at the White House. "That's a big step."

Trump originally floated the idea of the military paying for the wall over Twitter and in a discussion with Mattis late last month.

"Such a controversial move could only be funded by cutting other vital priorities for our service members, mere weeks after the Department communicated its needs to the Senate Defense Appropriations Subcommittee during omnibus appropriation negotiations," Democratic Sens. Jack Reed and Dick Durbin wrote.

"We conclude that the Department of Defense has no legal authority, with or without a reprogramming request, to use appropriated funds for the construction of a border wall."

The letter from Reed, of Rhode Island, and Durbin, of Illinois, comes on the heels of reports that Trump suggested the idea to "several advisors" after being disappointed by the amount of money allocated for border security in the $1.3 trillion omnibus.

Dana White, the Pentagon's chief spokesperson, confirmed last week that Mattis had "initial" talks with Trump about diverting a portion of the DOD's budget to construct a wall on the border.

The Pentagon did not immediately respond to CNBC's request for comment.

Congress would have to appropriate the money to make it work — a notion Sen. Tim Scott, R-S.C., touched on over the weekend. Scott said that Congress would "absolutely" need to weigh in on reprogramming defense funds to the border wall.

"The reality of it is, as commander-in-chief, he can certainly send signals through Secretary Mattis, have a conversation with Congress about where those dollars should be spent," Scott said told CBS' "Face the Nation" on Sunday.