Germany will compensate more that 50,000 gay men who were jailed for their sexual orientation.

The plan will see 30 million euros set aside to compensate homosexuals who were convicted for their sexuality.

Paragraph 175 was part of Germany’s criminal code until 1994 and made sex between men illegal. Over 140,000 men were convicted under this paragraph. Around 50,000 were prosecuted.

A draft law will be formally announced this month after the initial announcement was made in May. Records of those convicted will also be cleared.

Germany’s justice Minister, Heiko Maas said the compensations would depend on “concrete individual cases.” When determining compensation, sentence duration will be taken into consideration.

“We will never be able to remove these outrages committed by this country but we want to rehabilitate the victims. The convicted homosexual men should no longer have to live with the black mark of a criminal conviction,” he added.

The minister expected more than five thousand men to make personal claims.

East Germany stopped applying the law in 1968 and West Germany followed suit a year later. However, the code was not completely abolished until 1994.

Nazi-era convictions of homosexuals were lifted in 2002 but there has not yet been a pardon for those sentenced outside of the Nazi timescale. The anti-gay law was strict during this time and led to thousands of gay and bisexual men being taken away to concentration camps.

Following the war, gay men were still often arrested and put into prison. Members of the LGBT community often lost their jobs and homes and suffered social exclusion.

The Green and Left party in Germany have previously demanded compensation for those affected by the legislation. Spokeswoman for the Green party, Katja Keul described the lack of willingness to make amends before now “a monstrous disgrace.”