Matt Prior's 12th and arguably best first-class hundred of his career rescued Sussex on a fluctuating second day at Headingley which ended with the county on top.

Prior defied some high quality bowling, notably from Matthew Hoggard and Jason Gillespie, to help turn around their fortunes after they had slumped to 115-5 in response to Yorkshire's 272.

They were bowled out for 301 and then had the added bonus of two second- innings wickets in six overs before the close as Yorkshire finished on 3-2, still 26 runs in arrears.

You would have got long odds on Prior reaching his landmark when he was joined by last man Jason Lewry with 23 more required for his hundred.

Lewry caused a few heart-stopping moments, not least for the man at the other end, playing and missing regularly as Hoggard and Gillespie looked to finish things off with the second new ball.

But Prior farmed the strike carefully and then began to cut loose, denting Hoggard's figures when he pulled him 20 rows into the bleachers backward of square before giving himself room with a carve through point off the England man in his next over as he moved into the nineties.

Lewry survived a couple of deliveries from Gillespie when his partner was on 99 before a single off Hoggard in the next over brought Prior an 11th hundred for the county in his first Championship appearance of the season. The chastened Hoggard took time to congratulate his England colleague. Their's had been an absorbing duel with honours just about even.

Yorkshire's frustration did not end there and the plaintive cry of 'You'll never get 'em oot' from one supporter perched on top of Headingley's Winter Shed summed up their predicament. Nothing frustrates a fielding side more than a last wicket stand.

Lewry's innings was a model of self denial. In 71 minutes he played just one scoring shot but while he hung around Prior was able to guide Sussex to the unexpected bonus of a third batting point and a lead of 29 before he was bowled off an inside edge for 124, having faced 205 balls and hit 13 fours.

It got better for Sussex as Yorkshire lost two wickets in an awkward mini-session before stumps.

Matthew Wood was leg before to Rana Naved offering no shot and nightwatchman Gillespie missed Lewry's inswinger in the next over.

Of almost as much value to Sussex on a day when the Yorkshire attack showed commendable discipline was Carl Hopkinson's career-best 65, chiselled out in eight minutes shy of five hours.

As top order partners came and went in the morning session, the 24-year-old was patience personified, putting away the bad balls - not that there were many - but content to settle for long periods of watchful defence as the Yorkshire seamers maintained exemplary off stump lines.

A year ago Hopkinson was playing against a combined Essex and Kent second team.

Now, in only his tenth Championship game, he was resisting an attack with 456 Test wickets between them and, more importantly, looking the part.

Unfortunately not all the Sussex batsmen had to be prised out so carefully.

Nightwatchman Luke Wright fell to Hoggard early on but Mike Yardy was starting to propser when he slapped a rare long hop from Gillespie straight to point and Murray Goodwin shouldered arms to Tim Bresnan in the next over, the only debate being whether the ball which hit the flap of his pad would have gone over the stumps.

Even Chris Adams was subdued by the consistency of the bowling, scoring just 12 in an hour before he drove loosely at Anthony McGrath's cutters and was caught at slip.

Hoggard and Gillespie returned after lunch and for a while Hopkinson and Prior could do little but sit in. But slowly they turned the tide, adding 51 in 22 overs before the unfortunate Hopkinson's long vigil ended when the ball misbehaved for the first time all day, Bresnan getting one to lift off a length to take the edge.

Hopkinson faced 199 balls and hit six of them for four.

Prior had a let-off on 38 when Joe Sayers and Matt Wood collided trying to catch a lofted straight drive while Robin Martin-Jenkins looked in great form, swatting Richard Dawson for six over midwicket as the seventh wicket pair added 50 in just 42 minutes.

Martin-Jenkins could not quite believe his luck when he drilled a full toss from Darren Lehmann straight to midwicket and Rana Naved soon carved the first delivery with the second new ball to third man to give Hoggard his third wicket.

At that stage Sussex were still 42 runs in arrears but Mushtaq helped Prior add 19 before Gillespie had Mushtaq caught at third slip. Yorkshire's frustrations, and those of that fan on the Winter Shed, were only just beginning.