England are clinging on in the first Test against South Africa after a Ben Stokes-inspired fightback on day two at Lord's.
South Africa opener Sarel Erwee, with 73, was the first to put the Proteas in a commanding position, a lead of 27 with seven first-innings wickets in hand.
But Stokes bounced out Erwee, then had Rassie van der Dussen lbw as part of a South Africa slide from 160-2 to 210-6.
The rot was stopped by Marco Jansen and Keshav Maharaj, who shared a vital partnership of 72 from only 75 balls.
With England looking tired and the game slipping away, Stokes had Maharaj hook to Matthew Potts for 41, leaving Jansen unbeaten on 41 and South Africa 289-7, an advantage of 124.
England had earlier been bowled out for 165, with Ollie Pope out for 73.
Pope was the first of three wickets to fall to Kagiso Rabada, the pace bowler sublime in claiming 5-52.
Proteas on top as Lord's turns red
The day that Lord's was splashed with red for the Ruth Strauss Foundation was perhaps the most attritional of England's new era.
South Africa had the better of the majority of it, and would already be out of sight had it not been for Stokes.
The Proteas were helped by the inconsistency of an England attack that looked rusty - neither James Anderson nor Stuart Broad have played since the win over India at the start of July, despite having opportunities in the County Championship and for the England Lions.
With the movement on offer, there were times when the bowling on Thursday was more disappointing than the batting struggles on Wednesday.
Stokes tried everything he could as captain - he kept five slips in place for long periods - but it was with the ball where he made the crucial impact.
Still, the Jansen-Maharaj partnership was incredibly damaging to England and has left them with little room for error.
The home side are not out of this Test, but must make full use of a second new ball that will be available after three overs on the third morning.
Stokes strikes give England hope
South Africa openers Erwee and Dean Elgar are the antithesis of England's dashers, and doggedly blunted the home attack in a partnership of 85.
Captain Elgar overturned being given caught behind and was dropped by Crawley at second slip, both on seven, and even after he unluckily deflected Anderson on to his stumps to depart for 47, Broad wasted the opportunity to run out Keegan Petersen.
Petersen was ultimately drawn into a loose drive by Potts and Aiden Markram edged a beautifully flighted delivery from Jack Leach, but Erwee remained.
The left-hander has spent the beginning of the summer playing club cricket in Surrey for Weybridge and looked set for a Lord's hundred until Stokes' intervention.
Despite an obvious short-ball plan, Erwee got into a tangle against a vicious bouncer and was caught by Ben Foakes, before Stokes trapped Van der Dussen with a hooping inswinger.
When Kyle Verreynne edged behind to give Broad his 100th Test wicket at Lord's, South Africa had lost four wickets for 50 runs.
England had the momentum and backing of the crowd, only for Jansen and Maharaj to absorb the pressure, then dish out some punishment to all of Broad, Anderson and Stokes, the latter hooked for six by Jansen.
Stokes, hobbling through a persistent knee problem, was able to muster the energy for another bouncer, with Maharaj's miscue held by Potts at mid-wicket.
Rabada runs through England tail
Any hope that England had of pushing their overnight 116-6 towards 200 rested on Pope, who began the day on 61.
Pope was dropped by first slip Erwee off Rabada in the opening over and, when he dragged a loose drive at the same bowler on to his stumps, South Africa surged.
Rabada was magnificent, swinging the ball, but also cleverly deceiving Broad with a slower ball. After Jansen bowled a swiping Leach, Rabada trapped Anderson lbw to earn a place on the Lord's honours board for the first time.
Despite mustering such a meagre total, England would have felt in the game because of the helpful bowling conditions.
That hope was tested by Erwee, Jansen and Maharaj, but Stokes kept his side in contention.
'Childhood dream' - reaction
England spinner Jack Leach, speaking to BBC Sport: "Obviously we're behind in the game but there's still plenty to play for. A few quick wickets in the morning and then we've got to bat really well second innings.
"It's quite similar [to positions we've been in throughout the summer]. We've got to take belief from that we've been here before and it's about fighting for every moment in the upcoming days.
"We've had it before at Lord's where it is trickier to bat in the first innings then perhaps you get a heavy roller on it and that makes a difference,"
South Africa bowler Kagiso Rabada, speaking to BBC Sport: "It's basically a childhood dream to be up on the Lord's honours board. I remember getting a four-for here in a one-day international and just missed it so I'm glad I could go over the line, especially in Test cricket.
"Two weeks ago I wasn't sure if I was going to play [because of an ankle injury]. That's how much pain I was in. But thankfully, the medical staff have taken time out to help me out. I know it's their job but they did a fantastic one."