Hannibal Hanschke / Reuters About 50,000 men were punished under the law that was drawn up in the 19th century, strengthened by the Nazis and only dropped in 1969 when homosexuality was decriminalized.

Thousands of gay men prosecuted and jailed under an arcane German law were due to get compensation after the government passed a draft bill on Wednesday to quash their convictions.

About 50,000 men were punished under the law that was drawn up in the 19th century, strengthened by the Nazis and only dropped in 1969 when homosexuality was decriminalized.

Each surviving man would get 3,000 euros ($3,200) in compensation and 1,500 euros for each year spent in prison, the justice ministry said in a statement.

“The rehabilitation of men who stood trial only because of their homosexuality is overdue,” Justice Minister Heiko Maas said.

“Only because of their love of men, because of their sexual identity were they persecuted, fined and ostracized.”

The law still needs to be approved by the Bundestag lower house of parliament.

“The victims of this injustice have had to wait a long time,” said Christine Lueders, head of Germany’s Anti-Discrimination Agency, a body that helped push through the reform.

“They had suffered all their lives from the sentences and the consequences.”

(Reporting by Joseph Nasr; Editing by Andrew Heavens)