NOTTINGHAM, England (AP) — South Africa came through two difficult periods to reach 309-6 against England at stumps on Day 1 of the second test on Friday, suggesting the Proteas' gamble to bat first in difficult conditions may have paid off.

South Africa was 66-2 and 235-6 before fighting its way back both times and edging the opening day on a Trent Bridge pitch where runs may be hard to come by.

First, a 113-run partnership between Hashim Amla (78) and Quinton de Kock (68) took the Proteas out of early trouble and to 179-2 at tea.

Stuart Broad (3-47) and Ben Stokes (2-77) combined to take four wickets early in the final session for England but South Africa came back again with an unbroken 74-run stand between bowlers Vernon Philander (54 not out) and Chris Morris.

Returning South Africa captain Faf du Plessis trusted his batting lineup on a cloudy morning at Trent Bridge, choosing to bat first in a calculated gamble.

England got what it wanted after skipper Joe Root said he would have bowled anyway, yet despite having the South Africans on the ropes early in the final session, when De Kock fell first ball after tea, the home team couldn't force home its advantage.

England's seamers have had big recent success at Trent Bridge, including bowling Australia out for 60 in less than 20 overs in the Ashes two years ago, and James Anderson and Broad both have their career-best figures at the ground.

That made Du Plessis' decision to bat first a debatable one, and South Africa had to negotiate an abundance of swing from England's quick bowlers throughout the day — and also a 20-minute rain delay just before lunch.

Anderson removed opener Dean Elgar (6) early via a sharp diving catch at backward point by Liam Dawson. Heino Kuhn weathered an early storm, when he got hit on the helmet, but Broad bowled him for 34 with a delivery that seamed back a long way.

Amla became the fourth South African past 8,000 tests runs. Alongside him De Kock, promoted up to No. 4, played his attacking game, hitting eight fours and scoring quickly to take the Proteas to a position of control after two sessions.

England's persistence paid off in a 15-over spell after tea, beginning when De Kock tried to play expansively to the first ball of the session from Broad and edged to Alastair Cook at first slip.

Amla, Du Plessis and Temba Bavuma followed, with Broad and Stokes swinging the ball both ways in a period of complete dominance for England.

Philander and Morris swung the momentum back South Africa's way in the last hour, though, with Philander collecting 36 of his 54 runs in boundaries.

England leads the four-test series after a convincing 211-run win at Lord's in the first game.