U.S. President Donald Trump has signed legislation to compel the Department of Justice to release files on the late, disgraced financier Jeffrey Epstein.

Trump said in a social media post that he signed the legislation Wednesday, approving a measure he had spent months trying to block in a fight that inflamed tensions in his own party and threatened to undermine his agenda.

The president’s signature marked a stunning about-face for Trump, who had assailed the effort to require the release of the government’s files on Epstein — a convicted sex offender, who was facing federal charges of trafficking underage girls when he died in jail in 2019.