The home side were 175-4 at tea on Monday with Thilan Samaraweera unbeaten on 44 and Tillakaratne Dilshan on 19.
After being reduced to 61-3 a little before lunch, Sri Lanka recovered in the second session thanks to an 81-run partnership between Samaraweera and Sangakkara (79).
Sangakkara, fresh from a brilliant 185 in the first Test, played aggressively despite the early setbacks and brought up his 20th half-century with an exquisite cover-drive off paceman Umar Gul.
The 28-year-old left-hander was looking set for a big score at his home ground but was given out caught bad-pad to leg-spinner Danish Kaneria after he had struck 15 fours off 98 balls.
Earlier, Asif grabbed three early wickets after Sri Lanka were put in to bat by Inzamam-ul Haq.
He ensured a fine start for the visiting side after the first match in Colombo ended in a draw, generating steep bounce in overcast conditions.
Asif got the outside edge of opener Upul Tharanga (ten) who was caught at second slip by Younis Khan, and then bowled Sanath Jayasuriya (14) between bat and pad after the batsman had hooked paceman Umar Gul for a six.
Jayasuriya, playing his last Test, had been dropped by Imran Farhat off Gul when on seven.
Asif bagged his third wicket when stand-in captain Mahela Jayawardene (four) nicked one to Farhat at second slip.
Pakistani opener Shoaib Malik was ruled out of the match due to high fever.