Two days after Trump's abrupt about-face, the House of Representatives passed the measure with a vote of 427-1, sending a resolution requiring the release of all unclassified records on Epstein to the Republican-majority Senate, which swiftly approved it.
The bill could now go to Trump for his signature as soon as Wednesday.
Trump plans to sign the bill when it reaches his desk, a senior White House official said.
The Epstein scandal has been a political thorn in Trump's side for months, partly because he amplified conspiracy theories about Epstein to his own supporters.
Many Trump voters believe his administration has covered up Epstein's ties to powerful figures and obscured details surrounding his death, which was ruled a suicide, in a Manhattan jail in 2019.
Epstein was a New York financier who fraternised with some of the most powerful men in the country.
Before the House vote, about two dozen survivors of Epstein's abuse joined a trio of Democratic and Republican lawmakers outside the US Capitol to urge the release of the records.
The women held photographs of their younger selves, the age at which they said they first encountered Epstein.
After the vote, they stood to applaud lawmakers from the House's public gallery, some of them crying and hugging each other. Despite his changed position on the bill, Trump remains angry about the attention paid to the Epstein matter.
On Tuesday, he called a reporter who asked about it in the Oval Office a "terrible person" and said the television network the journalist works for should have its license revoked.
"I have nothing to do with Jeffrey Epstein," the Republican president told reporters while hosting a visit by Saudi Crown Prince Mohammed bin Salman.
"I threw him out of my club many years ago because I thought he was a sick pervert."
The White House was caught off-guard by how quickly the measure passed through Congress, having expected it to take longer in the Senate, according to two people with direct knowledge of the matter.
The fight over the Epstein papers has taken a toll on Trump's public approval, which fell to its lowest point this year.
A Reuters/Ipsos poll released on Monday found that just one in five voters overall approved of his handling of the matter. Among Republicans, just 44 per cent thought Trump was handling the situation well.
Trump socialised and partied with Epstein in the 1990s and 2000s before what he calls a rift, but the old friendship has become a rare weak spot for the president with his supporters.
"Please stop making this political, it is not about you, President Trump," Jena-Lisa Jones, who said Epstein sexually abused her when she was 14, told a press conference outside the Capitol a few hours before the vote.
"I voted for you, but your behaviour on this issue has been a national embarrassment."
The family of Virginia Giuffre, one of Epstein's most prominent accusers, emerged from the vote with tears of gratitude. She died by suicide earlier this year.
Her brother, Sky Roberts, called on Trump not to delay.
"The reality is, right now, he could release the files today if he really wanted to," he said.
Trump has said he had no connection to Epstein's crimes and has begun calling the issue a "Democratic hoax," even as some Republicans were among the loudest voices calling for the release of the records from criminal investigations of Epstein.
Epstein pleaded guilty to a Florida state felony prostitution charge in 2008 and served 13 months in jail.
The US Justice Department charged him with sex trafficking of minors in 2019. Epstein had pleaded not guilty to those charges before his death.
Lifeline 13 11 14
beyondblue 1300 22 4636