Nissanka leads strong Sri Lanka batting reply
Sri Lanka were 242-3 at the close in reply to South Africa's first innings of 358.
Opening batsman Nissanka seemed set for his third Test century before he charged down the wicket against left-arm spinner Keshav Maharaj, missed an attempted big hit and was bowled.
Until then, Nissanka's only blemish was a missed chance to David Bedingham at first slip off Kagiso Rabada when the batsman had 22. Nissanka faced 157 balls and hit 11 fours and a six.
"Pathum was so good to watch but he will blame himself for the manner he got out," said Sri Lankan batting coach Thilina Kandamby.
"The bowlers were tired, the wicket was flat and he missed out. Even I could not believe it, but clearly there was a lapse of concentration.
"Pathum works very hard on his game. He has improved his strike rate in white ball cricket and when he came back to the Test side he wanted to know what to do to play long innings. He did well today but that last shot was a disappointment."
Nissanka shared stands of 41 with Dimuth Karunaratne (20), 109 with Dinesh Chandimal (44) and 49 with Angelo Mathews, who finished the day on 40 not out.
Kamindu Mendis joined Mathews after Nissanka was dismissed and batted brightly to make 30 not out in an unbeaten partnership of 43.
Friday's performance was in stark contrast to Sri Lanka's collapse to a record low of 42 all out in the first Test in Durban, which South Africa won by 233 runs.
"We all knew where we went wrong in Durban in the first innings. We went after a lot of balls wide outside off stump. These things happen in Test cricket. The boys were up for the challenge," said Kandamby.
Kandamby added that the match was evenly poised but that Sri Lanka had an opportunity to take charge by securing a big first innings lead.
South Africa earlier added 89 for the loss of their last three wickets after resuming on 269-7. Wicketkeeper-batsman Kyle Verreynne needed just 49 balls to go from his overnight 48 not out to 105 not out.
Verreynne and Rabada (23) put on 56 for the ninth wicket and last man Dane Paterson (9) helped Verreynne add 33 before he was last man out, caught off an attempted slog against Lahiru Kumara.
"It's very even at the moment," said Verreynne. "After what happened in the first Test it was easy to think that we could have potentially blown them away after the way we batted.
"But they have come out and played really nicely and the pitch looks like it's getting better and better to bat on.
"If we can get two or three early wickets in the morning I think it will be in our favour. But I think both teams will think tonight that they've got a fair shout."