Moeen Ali became the first England off-spinner to take four wickets in a Test innings at Trent Bridge for 61 years but his side are facing a massive task in the second match of the Investec Series against South Africa.
Moeen Ali picked up four wickets in the space of five overs and took his tally in the series so far to 14.
The Worcestershire all-rounder struck in his 12th, 13th, 14th and 16th overs and finished with 4-78 from 16 overs.
But South Africa declared in their second innings at 343-9 to set England a daunting 474 target. They reached 1-0 by the close.
Moeen made his initial breakthrough in the final over before the second new ball was due as Temba Bavuma (15 holed out to skipper Joe Root at wide mid off.
He was then taken out of the firing line when the new ball was taken but returned to pick up three late wickets.
Chris Morris (13) swung across the line and perished to a top edge as Gary Ballance held the catch moving from short fine leg.
In Moeen's next over, spinner Keshav Maharaj (1) was the victim of a superb diving catch by Stuart Broad at long on.
Vernon Philander (42) struck Moeen for two sixes but in the same over attempted a slog sweep and the ball came off the toe of the bat and provided a return catch.
The Proteas immediately declared and England openers Alastair Cook and Keaton Jennings survived four overs.