WASHINGTON (Reuters) - The U.S. Senate on Wednesday approved a $4.6 billion bill to address the migrant surge at the border with Mexico, setting up a negotiation with the House of Representatives and President Donald Trump over the funds and how they should be spent.

Trump on May 1 requested the aid for programs that house, feed, transport and oversee record numbers of Central American families seeking asylum in the United States and straining capacity at migrant shelters in border cities.

The Republican president, who spoke with Democratic House Speaker Nancy Pelosi on Wednesday, told reporters he believed Pelosi “wants to get something done.” He was optimistic about a congressional solution to help U.S. officials at the border who say they are overwhelmed by the surge of migrants.

Congressional leaders have a choice between a bill from the Republican-controlled Senate and a more restrictive $4.5 billion bill passed by the Democratic-led House on Tuesday night. They also could strike a compromise and send that to Trump.

With U.S. officials saying they will run out of money for border agencies soon, leaders of both parties stressed that the need is great.

“We’ve got Border Patrol agents right now pulling money out of their own pockets to pay for diapers for these kids,” Representative Steve Scalise, the No. 2 House Republican, told reporters.

The House-passed bill contains health and nutrition standards for migrants in custody as well as other controls on U.S. immigration agencies following reports of poor conditions facing children at overcrowded facilities. Trump has threatened to veto that approach and the Senate rejected it on Tuesday.

Slideshow ( 2 images )

The Senate then passed its own proposal, which has fewer restrictions than the House version, but includes money - left out by the House - to pay overtime for Immigration and Customs Enforcement (ICE) employees. It also includes $145 million to help the Defense Department cover costs for Pentagon operations at the border that Trump ordered.

The two chambers must resolve their differences before sending legislation to Trump to sign into law. This puts Pelosi in a tough position. She worked hard to convince many progressive Democrats to back the House bill, and some are not keen on the Senate version.

Democratic Representative Alexandria Ocasio-Cortez dismissed the Senate’s measure. “The Senate bill is not a humanitarian bill by any stretch of the imagination,” she told reporters.

Pelosi called Trump Wednesday to “try to reconcile” the House and Senate bills and they talked for 15 minutes, a senior Democratic aide said. Senate Democratic Leader Chuck Schumer said Pelosi suggested a few changes but Schumer did not outline them.

The Senate bill does not fund any additional ICE detention beds, and prohibits officials from using any of the appropriated funds for other purposes.

The Senate bill contains several provisions that backers hope will make it more attractive to House Democrats. For instance, the measure prohibits ICE from going after undocumented immigrants based on information obtained from potential sponsors of unaccompanied migrant children.

Lawmakers hurried to pass legislation before taking a recess next week. Their action follows an outcry over conditions at the border. Attorneys last week found more than 300 migrant children in an overcrowded Texas border patrol station, where they said some had been held for weeks in squalid conditions.