In 1980, under pressure to begin construction on what would become his signature project, Donald 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 New York's Fifth Avenue, where the 58-story, golden-hued Trump Tower now stands.

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

Their treatment led to years of litigation over Mr Trump’s labour practices, and in 1998, despite frequent claims that he never settles lawsuits, he 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 US District Court judge for the Southern District of New York, in response to a 2016 motion filed by Time Inc. and the Reporters Committee for Freedom of the Press. 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.”

In a 21-page finding, Preska wrote that “the Trump Parties have failed to identify any interests that can overcome the common law and First Amendment presumptions of access to the four documents at issue.”

On the campaign trail and as president, Trump has made curbing immigration one of his top priorities, seeking to close the borders to people from certain Muslim-majority countries and to deport immigrants who are here illegally. The settlement serves as a reminder that as an employer he relied on illegal immigrants to get a dangerous and dirty job done.

Katie Townsend, litigation director of the Reporters Committee, called the decision a major victory that goes beyond this one case. “It makes clear that both the First Amendment and common law rights of public access apply to settlement-related documents in class actions,” she said.

Lawyers for Trump were not immediately available for comment.

Donald Trump calls Elizabeth Warren 'Pocahontas' in front of Native American veterans

The documents show that Trump paid $1.375 million to settle the case, known as Hardy vs Kaszycki, with $500,000 of it going to a union benefits fund and the rest to pay lawyers’ fees and expenses. According to the documents, one of the union lawyers involved asked the judge to ensure “prompt payment” from Trump, suggesting “within two weeks after the settlement date.”

Trump jumped in to object. “Thirty days is normal,” he said.

For the demolition work, Trump hired an inexperienced contractor, William Kaszycki of Kaszycki & Sons, for $775,000 (£585,000). Kaszycki specialized in window and job-site cleaning. His company was renovating an adjoining building for Bonwit Teller, where he employed undocumented Polish workers.

Trump would later testify that he never walked into the adjoining building or noticed the Polish workers. But a foreman on the job, Zbignew Goryn, testified that Trump visited the site, marvelling to him about the Polish crew.

“He liked the way the men were working on 57th Street,” Goryn said. “He said, ‘Those Polish guys are good, hard workers.'”

The demolition began in January 1980. It was hard, dirty work, breaking up concrete floors, ripping out electrical wiring and cutting pipes while labouring in a cloud of dust and asbestos.

A smaller group of union demolition workers, who were paid much higher wages and, unlike the Poles, overtime, often made fun of their Polish co-workers, according to the testimony of Adam Mrowiec, one of the Polish labourers. “They told me and my friends that we are stupid Poles and we are working for such low money,” he said.

In 1998, Wojciech Kozak described to The New York Times the backbreaking labour on the job.

“We worked in horrid, terrible conditions,” Kozak said. “We were frightened illegal immigrants and did not know enough about our rights.”

Today, Kozak, now 75, lives at the O’Donnell-Dempsey Senior Housing building in Elizabeth, New Jersey.

Activists protest Donald Trump's proposed Muslim ban Show all 11 1 /11 Activists protest Donald Trump's proposed Muslim ban Activists protest Donald Trump's proposed Muslim ban People listen to speakers at a demonstration against racism and conservative presidential candidate Donald Trump's recent remarks concerning Muslims on December 10, 2015 in New York City. Dozens or demonstrators and activists converged at Columbus Circle to denounce the politics of Trump and the treatment of Muslim refugees both in America and Europe. Spencer Platt/Getty Activists protest Donald Trump's proposed Muslim ban People listen to speakers at a demonstration against racism and conservative presidential candidate Donald Trump's recent remarks concerning Muslims on December 10, 2015 in New York City. Dozens or demonstrators and activists converged at Columbus Circle to denounce the politics of Trump and the treatment of Muslim refugees both in America and Europe. Spencer Platt/Getty Activists protest Donald Trump's proposed Muslim ban People listen to speakers at a demonstration against racism and conservative presidential candidate Donald Trump's recent remarks concerning Muslims on December 10, 2015 in New York City. Dozens or demonstrators and activists converged at Columbus Circle to denounce the politics of Trump and the treatment of Muslim refugees both in America and Europe. Spencer Platt/Getty Activists protest Donald Trump's proposed Muslim ban People listen to speakers at a demonstration against racism and conservative presidential candidate Donald Trump's recent remarks concerning Muslims on December 10, 2015 in New York City. Dozens or demonstrators and activists converged at Columbus Circle to denounce the politics of Trump and the treatment of Muslim refugees both in America and Europe. Spencer Platt/Getty Activists protest Donald Trump's proposed Muslim ban People listen to speakers at a demonstration against racism and conservative presidential candidate Donald Trump's recent remarks concerning Muslims on December 10, 2015 in New York City. Dozens or demonstrators and activists converged at Columbus Circle to denounce the politics of Trump and the treatment of Muslim refugees both in America and Europe. Spencer Platt/Getty Activists protest Donald Trump's proposed Muslim ban People listen to speakers at a demonstration against racism and conservative presidential candidate Donald Trump's recent remarks concerning Muslims on December 10, 2015 in New York City. Dozens or demonstrators and activists converged at Columbus Circle to denounce the politics of Trump and the treatment of Muslim refugees both in America and Europe. Getty Activists protest Donald Trump's proposed Muslim ban People listen to speakers at a demonstration against racism and conservative presidential candidate Donald Trump's recent remarks concerning Muslims on December 10, 2015 in New York City. Dozens or demonstrators and activists converged at Columbus Circle to denounce the politics of Trump and the treatment of Muslim refugees both in America and Europe. Spencer Platt/Getty Activists protest Donald Trump's proposed Muslim ban People listen to speakers at a demonstration against racism and conservative presidential candidate Donald Trump's recent remarks concerning Muslims on December 10, 2015 in New York City. Dozens or demonstrators and activists converged at Columbus Circle to denounce the politics of Trump and the treatment of Muslim refugees both in America and Europe. Spencer Platt/Getty Activists protest Donald Trump's proposed Muslim ban People listen to speakers at a demonstration against racism and conservative presidential candidate Donald Trump's recent remarks concerning Muslims on December 10, 2015 in New York City. Dozens or demonstrators and activists converged at Columbus Circle to denounce the politics of Trump and the treatment of Muslim refugees both in America and Europe. Spencer Platt/Getty Activists protest Donald Trump's proposed Muslim ban People listen to speakers at a demonstration against racism and conservative presidential candidate Donald Trump's recent remarks concerning Muslims on December 10, 2015 in New York City. Dozens or demonstrators and activists converged at Columbus Circle to denounce the politics of Trump and the treatment of Muslim refugees both in America and Europe. Spencer Platt/Getty Activists protest Donald Trump's proposed Muslim ban People listen to speakers at a demonstration against racism and conservative presidential candidate Donald Trump's recent remarks concerning Muslims on December 10, 2015 in New York City. Dozens or demonstrators and activists converged at Columbus Circle to denounce the politics of Trump and the treatment of Muslim refugees both in America and Europe. Spencer Platt/Getty

He has blue eyes and a strong handshake, but speaks through a special device because he had a tracheotomy for cancer. He proudly showed off his citizenship papers, dated Nov. 3, 1995.

Kozak still recalls the work, and seeing Trump at the site in 1980.

“We were working, 12 to 16 hours a day and were paid $4 an hour,” he said. “Because I worked with an acetylene torch, I got $5 an hour. We worked without masks. Nobody knew what asbestos was. I was an immigrant. I worked very hard.”

But Kaszycki stopped paying the men, and they eventually took their complaints to a lawyer named John Szabo. Szabo went to Thomas Macari, a vice president of the Trump Organization, threatening to place a mechanic’s lien on the property if the men weren’t paid.

Still, there were problems. Szabo filed the lien, prompting Trump to ask for help from Daniel Sullivan, a labour consultant. Sullivan later testified that Trump described his “difficulties,” and “that he had some illegal Polish employees.”

Trump, however, testified that he did he not remember that there were undocumented Polish workers on the job, or signing paychecks for the crew. “I really still don’t know that there were illegal aliens,” Trump said on the stand.

Trump did, according to Szabo, have his lawyer call Szabo with a threat to call Immigration and Naturalization Service to have the men deported.

Szabo got the Labor Department to open a wages-and-hours case for the men, which ultimately won a judgement of $254,000 against Kaszycki.

Kaszycki had signed a contract with Local 79 of the House Wreckers Union. But while Kaszycki or Trump paid into the union welfare funds for the handful of union workers on the job, they had not done so for the bulk of the workforce, the undocumented, nonunion Poles.

A union dissident and former boxer, Harry Diduck, brought a case in federal court in 1983 against Kaszycki and, eventually, Trump and others, claiming that Kaszycki, the union president and Trump had colluded to deprive the welfare funds of about $600,000.

A judge ruled that Trump was a legal employer of the Poles, but both sides appealed elements of his decision, with the possibility that the total welfare funds could get reduced to $500,000 (£380,000). On the eve of a second trial, Trump settled.