Mr. Trump told New York magazine in 2002 that Mr. Epstein was a “terrific guy” whom he had known for 15 years.

“He’s a lot of fun to be with,” the president said at the time. “It is even said that he likes beautiful women as much as I do, and many of them are on the younger side.”

What is he accused of?

The charges against Mr. Epstein predate Saturday’s arrest by more than a decade, and involve a sordid history that has infuriated victims and raised questions of preferential treatment by law enforcement.

In 2005, the parents of a 14-year-old girl told the police in Palm Beach, Fla., that Mr. Epstein had molested their daughter at his home there. Before the police referred the case to the F.B.I. in 2006, they identified three dozen potential victims, who said that Mr. Epstein had paid them, while they were underage, for massages, oral sex and intercourse, according to a police report obtained by The Miami Herald.

The abuse dated back to 2001, according to The Herald. Most of the victims were between 13 and 16. Many came from low-income backgrounds and were told they could earn $200 or $300 for giving Mr. Epstein a massage , the Herald reported.

“We just wanted money for school clothes, for shoes,” one woman told The Herald.

Federal prosecutors in Miami initially drafted a 53-page indictment against Mr. Epstein. But in 2008, those prosecutors — led by Mr. Acosta, then the region’s United States attorney, and now Mr. Trump’s labor secretary — struck a deal with Mr. Epstein’s lawyers that allowed him to avoid federal charges. Instead, Mr. Epstein pleaded guilty to state charges of soliciting a minor for prostitution.

Under the federal charges, Mr. Epstein could have faced life in prison. After the deal, he served 13 months in jail. He had work-release privileges for six days a week, 12 hours each day, during which a private driver picked him up and took him to a nearby office.