The England batsman hit 30 fours and eight sixes in his 286-ball knock, sharing a 181-run third-wicket stand with Zander de Bruyn, who made 94.
Surrey reached stumps in their first innings on 430 for five in reply to Lancashire's 485 for seven.
Steven Croft moved past the 150 mark on Friday morning, finishing unbeaten on 154 after adding 50 of the Red Rose's 60 runs before declaring before lunch.
Pietersen's international captain also made an unbeaten century as Andrew Strauss finished the day on 127, with Middlesex 239 for two against leaders Nottinghamshire at at Uxbridge.
Middlesex, who conceded a first-innings deficit of 231, reached stumps with an eight-run lead ahead of Saturday's final day.
Chris Rogers made 59 and put on a 143-run stand with Strauss.
Meanwhile, Warwickshire and Sussex were frustrated by the weather as rain washed out the second day of their match at Edgbaston.
Rain halted play at tea on the first day when Warwickshire had reached 175 for three and it continued throughout the night and into the morning.
Elsewhere, Worcestershire and Durham's match at New Road was abandoned without a ball bowled on the final day as relentless rain led to a saturated playing surface. Each team took seven points, leaving both in the relegation positions.
Joe Root hit a career-best unbeaten 222 to rescue Yorkshire from a potential crisis against Hampshire at the Ageas Bowl.
Opening batsman Root, 21, confirmed his growing reputation with an innings of 26 fours and three sixes from 270 balls as Hampshire failed to make the most of a dominant start in the County Championship Division Two clash.
Root was 46 not out when Yorkshire began the third day at 83 for three from 26 overs and soon lost key members of the middle order in conditions helpful to the Hampshire seamers.
Hampshire were left 12 overs to negotiate and Jimmy Adams and Neil McKenzie survived to reach 39 without loss.
The problem for both sides is that only one day remains and with more rain forecast.
Elsewhere, rain meant no play was possible on day three of the match between Gloucestershire and Essex, with the hosts 284 for four in their first innings.