Ashwell Prince and Jacques Kallis hit half-centuries but Pakistan struck back with some disciplined bowling to restrict South Africa on day one of the second and final Test here.
South Africa had posted 259-6 with Prince (63) and Kallis (59) leading the charge at the Gaddafi Stadium when bad light stopped play seven overs ahead of schedule.
Mark Boucher was unbeaten on nine and Andre Nel was yet to score.
It seemed AB de Villiers (45) would ratchet up the South African total but he fell to an unfortunate run-out, giving Pakistan some advantage as they seek to level the series.
South Africa won the first Test in Karachi by 160 runs.
Captain Graeme Smith plundered 46 runs but none of his teammates followed suit against the spin and pace attack of Pakistan.
Key batsman Kallis, who scored a masterly 155 and an unbeaten 100 in the first Test, was not in the best form as he nearly played on Danish Kaneria twice. He regained composure though and hit paceman Umar Gul for two consecutive boundaries to reach his 45th half-century.
Kallis added an invaluable 83 runs for the fifth wicket with Prince, who also defied the bowling with some resolute stroke play.
Pakistan captain Shoaib Malik, who once again went into the Test with just two seamers and two frontline spinners, did not introduce left-arm spinner Abdul Rehman until the 51st over.
Rehman, who took eight wickets in Karachi, was hit for a six by Kallis before Kaneria struck back, trapping the South African with a disguising googly.
Kaneria, who bowled a long spell of 27 overs on either side of lunch, was the best of the home bowlers with 2-73.
Earlier, Kallis added 53 runs for the third wicket with Smith after the tourists lost Herschelle Gibbs (13) and Hashim Amla (10).
Pakistan's pace duo of Gul and Mohammad Asif provided the early breakthroughs. Gul had Gibbs caught in the gully while Asif bowled Amla with an inswinger.
Smith, batting with confidence on 31 with South Africa 70-2 at lunch, drove Kaneria for a boundary before the leg-spinner had the last laugh with a sharp turner which went through bat and pad to hit the off-stump.
Prince and Kallis took the score to 160 before Kaneria claimed the prized scalp of Kallis to raise hopes of dismissing the tourists for a modest total.
Prince, however, kept one end intact and consolidated the South African innings. Rehman finally brought an end to Prince's innings when he beat the batsman in the air to hit the stumps.
Prince hit five boundaries in his stubborn three-hour knock.
The Lahore Test is the swansong for Inzamam-ul Haq who is retiring from Test cricket.
The 37-year-old veteran was brought into the team along with Mohammad Yousuf. Inzamam was unavailable for the first Test while Yousuf pulled out at the last minute citing a lack of match fitness.
South Africa remained unchanged, leaving veteran all-rounder Shaun Pollock on the sidelines. Pollock was dropped for the first Test -- the first time in his 107-Test career.