The batsman blasted his way to a near run-a-ball ton for Surrey in their LV= County Championship match against Yorkshire at Headingley.
Pietersen's selection in next month's Trent Bridge opener had been placed under some uncertainty after he took longer than expected to recover from a knee injury which caused him to fly home from England's tour of New Zealand in February.
Pietersen was in fine fettle 16 days before the Ashes begins
The 32-year-old reached his century from just 106 balls - and went on to hit 17 fours and seven sixes.
Provided he suffers no setbacks, Pietersen is due to make his England return in Thursday's second Twenty20 international against New Zealand at The Oval.