Janusz Walus, 63, is serving a life sentence for the murder, which took the country to the brink of a race war and sent shockwaves across the world.
Protests erupted in black townships following the assassination of Hani, who often spoke out against violence.
"The court has ordered (Walus) be released within 14 days and the matter be referred back to the parole board to set his parole conditions," Walus's lawyer Julian Knight told AFP.
Last year, the man who provided Walus with the gun he used to kill Hani was released on medical grounds.
Also Read
Clive Derby-Lewis, 79, who is suffering from lung cancer went to court after several unsuccessful applications to the parole board.
Hani was the general secretary of the South African Communist Party and chief of staff of Umkhonto we Sizwe, the armed wing of the ruling African National Congress (ANC).
He was shot dead in the driveway of his house on April 10, 1993 in a suburb east of Johannesburg, one year before South Africa's first multi-racial elections.
One of South Africa's most notorious murderers, Eugene de Kock, was granted parole in January 2015 after 20 years in jail.
De Kock, dubbed "Prime Evil", was sentenced in 1996 to two life terms plus 212 years in prison for his activities as head of a police death squad targeting anti-apartheid activists.