Earlier, the Senate rejected a similar measure passed in the House of Representatives.
The Senate voted 84-8 to pass the measure that seeks to address the influx of migrants arriving at the US border with Mexico before funding runs out in July.
The Senate bill, unlike the House bill, provides additional funding for the Department of Homeland Security and the Defence Department.
Earlier in the day, US President Donald Trump said he talked to House of Representatives Speaker Nancy Pelosi about the chamber's humanitarian aid bill that was passed on Tuesday. The bill secures $4.5 billion in emergency spending to address the crisis at the border, including funding for legal assistance; food, water and medical services; and support services for unaccompanied children.
Trump said in an interview that he was not happy with the House humanitarian aid bill as it does not include any money for border protection.
Caravans of migrants from Central American countries began moving toward the United States through Mexico last fall. Trump has called the surge of arrivals a crisis and declared a national emergency in February to secure funds for constructing a border wall.