German carmaker Volkswagen (VW) says it will pay $6.4m (£5m) in compensation to former workers at a Brazilian factory who sued the company for collaborating with the country's military during the 1964-1985 dictatorship.
Workers and their families sued the carmaker five years ago over human rights violations.
A 2016 review found that VW agents gave employees' names to police hunting for people described as "subversives".
They were then detained and tortured.
"We regret the violations that occurred in the past. For Volkswagen, it is important to deal responsibly with this negative chapter in Brazil's history and promote transparency," VW executive Hiltrud Werner said in a statement.
VW's deal with Brazilian prosecutors, which was signed on Wednesday, will also see donations to projects including a memorial for victims of the dictatorship, the company said.
Twelve former workers said in 2016 they were arrested and tortured at Volkswagen's huge factory in São Bernardo do Campo, near São Paulo, while others were sacked and placed on blacklists.
Many were unable to find work for years afterwards, an investigation by Reuters news agency in 2014 found.
The 2016 review, which was commissioned by VW, found that company security agents monitored employees and informed military authorities when illegal communist flyers and newspapers were found.
"The management of VW do Brasil exhibited unreserved loyalty towards the military government," the review, which was written by Christopher Kopper, a history professor at Germany's Bielefeld University, found.
He told Reuters that there was "no clear evidence found that the cooperation was institutionalized by the company" but that human resources knew what was happening.
'Torture at work'
Brazil's national truth commission final report in 2014 described the case of VW employee Lucio Bellentani.
The commission, established to investigate abuses committed during military rule, found that state agents performed illegal arrests, torture, executions and forced disappearance systematically.
"I was at work when two people with machine guns came up to me," Mr Bellentani, a communist activist, said.
"They held my arms behind my back and immediately put me in handcuffs. As soon as we arrived in Volkswagen's security centre, the torture began. I was beaten, punched and slapped."
The commission found that more than 400 people were killed and around 40,000 people were tortured during Brazil's dictatorship.
The country is still coming to terms with what happened during military rule. Far-right President Jair Bolsonaro, a former army captain, has praised the former dictatorship and previously suggested some of its hardline policies should be re-introduced.