Centuries from Rory Burns and Dean Elgar put Surrey in a strong position before a determined Somerset fightback on the opening day of the Specsavers County Championship match at Taunton.
Having won the toss on a day of unbroken sunshine, the visitors ran up 330 for six, with skipper Burns contributing 107 and Elgar making 103 against one of his former clubs.
Surrey were 265 for two at one stage, but then lost four wickets for 30 runs as Lewis Gregory struck twice on his way to figures of three for 44 from 17 overs at the River End.
Ryan Patel (25 not out) and Riki Clarke (28 not out) steadied the ship and by the close Surrey had regained momentum going into day two.
Burns took the obvious decision to bat first on what appeared a true batting pitch under cloudless skies and was rewarded when he and Mark Stoneman put together an opening stand of 96 from 30.3 overs.
They were parted just before lunch when Stoneman, who had moved to his half-century off 105 balls, with six fours, edged a defensive shot off Jack Brooks through to wicketkeeper Steve Davies and departed for 50.
Shortly after the interval it was 99 for two as Scott Borthwick was caught at third slip by Craig Overton, driving at a delivery from Gregory.
With the total 108, Burns, on 42, survived a leg-side chance to Davies off Gregory. It proved an expensive miss as the Surrey captain moved to 50 from 109 balls, with 5 fours.
Elgar was more fluent, reaching his 50 off 71 deliveries and by tea the third-wicket partnership was worth 118, Surrey having progressed to 217 for two.
Burns had been given another life on 84 when Azhar Ali spilled a comfortable catch at deep square off Brooks. The final session saw the opener reach three figures with a leg glance for two off Craig Overton.
But Somerset stuck to their task well. When Burns finally fell to a top-edged pull shot that saw him caught at mid-on off Tim Groenewald, having faced 188 balls and hit 10 fours, the hosts sensed an opening.
It was 268 for four when Ben Foakes was caught behind for three off a fine delivery from Somerset captain Tom Abell, who delayed taking the new ball as the old one was swinging.
That proved sound thinking as Elgar, who cut Abell for four to reach a 165-ball ton, was pinned lbw by a toe-crushing yorker from Gregory.
Will Jacks fell without scoring, another leg-before victim for Gregory, and suddenly Somerset were on top for the first time.
They took the second new ball at the start of the 90th over with the score 314 for six, but failed to make another breakthrough against a confident Patel and Clarke.