(CNN) -- South Africa fought back in the first Test against Australia at the Wanderers Stadium to give themselves an outside chance of victory on the final day.
Ramdin's brilliiant double century in Barbados put West Indies on top.
The home side hustled out Australia for 207 in their second innings and chasing an improbable 454 to win were 178 for two wickets at the close of the fourth day.
Hashim Amla was on 43 and Jacques Kallis on 26 in a developing third wicket stand after the loss of openers Neil McKenzie and Graeme Smith.
They put on 76 for the first wicket until McKenzie was caught behind off Mitchell Johnson.
Amla and Smith then added 54 until the home skipper top-edged an attempted pull shot off Ben Hilfenhaus to be caught.
Australia were unable to make a further breakthrough, but will still be favored to go one up in the series, looking to revenge defeat to the South Africans on home soil earlier this year.
Ricky Ponting's men began the fourth day in a seemingly impregnable position as they looked to pile on the pressure after claiming a 246 run lead on first innings.
They reached 99 for one, but lost three wickets in the space of four balls to spark a collapse.
All-rounder Kallis sent back Ponting and Michael Hussey off successive deliveries and in the next over snaffled a superb slip catch to dismiss Michael Clarke as he edged spinner Paul Harris.
Wickets continued to tumble with top scorer Phil Hughes going after he had made 75 with Harris claiming another wicket.
Kallis ended with three for 22 and paceman Makhaya Ntini three for 29 and it needed a determined effort from the Australian tail, with the last two wickets adding 60, for the visitors to extend their lead past 400.
In other Test cricket action on Sunday, Kumar Sangakkara and Thilan Samaraweera scored centuries to help Sri Lanka recover from losing early wickets to Pakistan in Lahore.
Samaraweera followed his 231 in the drawn first Test in Karachi with a superb unbeaten 133 while Sangakkara scored 104.
Sri Lanka had been laboring on 35 for two wickets but ended the opening day on 317 for four.