Ryan Patel's maiden first-class century and Tom Curran's three wickets on day two helped Surrey maintain the upper hand against Essex at The Oval.
Patel was 100 not out when Surrey's first innings ended on 395, with Peter Siddle taking 6-104 for the visitors.
Curran (3-66) then removed ex-England captain Alastair Cook for just 11.
Essex looked in danger of a big first-innings deficit at 20-2, but Dan Lawrence (87 not out) got them to 202-4 before bad light ended play early.
Tom Westley (41) and Championship debutant Rishi Patel (31) helped to steady Essex's reply, and captain Ryan ten Doeschate (20 not out) will resume alongside Lawrence on the third morning.
Cook's distinguished Test career ended with a century against India at The Oval in September 2018, but his first innings at the ground since his international farewell lasted only 20 balls before he edged Curran behind to wicketkeeper Ben Foakes.
The morning session belonged to Surrey batsman Patel, who had been 70 not out overnight with only three home wickets remaining.
The 21-year-old had progressed to 84 by the time last man Morne Morkel came to the crease, but the big South African paceman hung around for eight overs to allow Patel to reach three figures.
Alastair Cook made a century in his final Test innings at The Oval against India last summer