Updated

CAPE TOWN, South Africa (AP) Temba Bavuma became the first black South African to make a test century, helping his team defy England in the second test on Tuesday and respond to the tourists' huge 629-6 declared with its own mammoth 627-7 declared.

Captain Hashim Amla made 201 and Bavuma reached 102 not out to effectively wipe out England's advantage and push the game toward a draw on a serene batting pitch where runs flowed and bowlers struggled.

England was 16-0 in its second innings to lead by 18 after batting out the last six overs of the day. With one day left, a victory for either team is unlikely.

England still leads the four-match series 1-0 but South Africa will take heart from a return to form from their batting lineup ahead of decisive tests in Johannesburg and Centurion.

Amla's dismissal sparked three quick wickets in the afternoon and a brief opportunity for England to push for victory.

But Bavuma and tailender Chris Morris responded with a century stand.

Bavuma sent a thick edge down to third man for four for his century, and celebrated by waving his bat at the crowd in the city where he was born. Bavuma's family watched from the stands.

The edge to reach his century was out of kilter with the rest of his maiden test hundred, where he played an array of smooth cover drives and powerful hook shots to frustrate England's bowlers.

South Africa declared soon after Bavuma's century, giving itself just under 30 minutes to bowl at England on the penultimate day of the match. England held firm to not lose a wicket.

Like England's batsmen in the first innings, the South Africans were helped by a dream batting pitch in Cape Town. The pitch was so good that South Africa tailender Morris hit boundaries with reverse sweeps off England spinner Moeen Ali, and was the fifth South African to go past 50 with his 69.

Earlier in the afternoon, Stuart Broad took two wickets and James Anderson one in quick succession to give the tourists a brief chance. England claimed those three wickets in four overs after going more than 70 overs without any success.

Broad began by bowling Amla for 201 and had Quinton de Kock caught for just five. Between those strikes, Anderson forced out Faf du Plessis for 86.

The three rapid strikes threatened to derail South Africa's fightback and leave it still some way behind. When De Kock went, South Africa was still 180 runs adrift.

But the hosts responded with a 167-run partnership between Bavuma and Morris. Bavuma moved to his second test 50 off just 52 balls and hit 16 fours in all in his innings, many with hooks and pulls as the England quicks tried to test the short player with short-pitched bowling.

Bavuma found a willing partner in bowler Morris, who was making his test debut. South Africa held England at bay - but also attacked in stages during their rapid stand.

England's bowlers were let down by a series of dropped catches over the past three days: Amla survived multiple chances, and AB de Villiers, who made 88, Faf du Plessis (86), Bavuma and Morris were also dropped.

Amla made his fourth double century just before lunch, leading South Africa's fightback following England's imposing total and Ben Stokes' stunning 258 from 198 balls.

The South African captain struck 27 boundaries before falling to Broad, who got the new ball to move just enough to bowl Amla off an inside edge. Du Plessis fell next over to an edge to Ben Stokes at third slip off Anderson. And when the recalled De Kock hit a hook straight to Anderson at backward square leg, England had done some serious damage with the new ball, and had hopes of rolling over South Africa for a decent lead.

That didn't happen as Bavuma, also the first black specialist batsman to play for South Africa, made a significant mark on a game that is now heading for a draw.