In 1980, under pressure to begin construction on what would become his signature project, Donald J. Trump employed a crew of 200 undocumented Polish workers who worked in 12-hour shifts, without gloves, hard hats or masks, to demolish the Bonwit Teller building on Fifth Avenue, where the 58-story, golden-hued Trump Tower now stands.

The workers were paid as little as $4 an hour for their dangerous labor, less than half the union wage, if they got paid at all.

Their treatment led to years of litigation over Mr. Trump’s labor practices, and in 1998, despite frequent claims that he never settles lawsuits, Mr. Trump quietly reached an agreement to end a class-action suit over the Bonwit Teller demolition in which he was a defendant.

For almost 20 years, the terms of that settlement have remained a secret. But last week, the settlement documents were unsealed by Loretta A. Preska, a United States District Court judge for the Southern District, in response to a 2016 motion filed by Time Inc. and the Reporters Committee for Freedom of the Press. Judge Preska found that the public’s right to know of court proceedings in a class-action case was strengthened by the involvement of the “now-president of the United States.”