The amendment sponsored by Jeff Sessions, the conservative Alabama senator, will authorise the construction of a three-layer fence along 600km of the lengthy border.
It would also see the construction of barriers to block vehicles along about 800km of the border.
The measure passed in an 83-16 vote on Wednesday.
"By passing my amendment, we are sending a signal that we are serious about stopping the flow of illegal immigrants over the border," Sessions said.
"A border fence, combined with National Guard forces, increased border patrol agents and more bed space for arrested illegal aliens, will help us reach a tipping point where the scales tip from illegality to legality.
"If we continue to send signals like this, that the open-border days are over, people will know that it makes more sense to apply and come into our country legally, according to our laws, rather than trying to come in illegally," the senator added.
The amendment represents a rare victory by the Senate's most conservative members in the fight over what to do about massive illegal immigration, most of it over the porous 3,162-km US-Mexico border.
There are an estimated 11.5 million undocumented immigrants in the US, and various proposals on how to address the problem are under consideration, including a guest-worker programme backed by George Bush, the US president, and a tough House of Representatives draft law which would criminalise illegal immigrants.
The House's bill also provides for building a border wall, but one that is almost twice as long as the Senate's fence plan, at about 1,000km.