Pakistan secured a Test victory in Rawalpindi, ending a two-year winless streak in the format. The defeat marked a historic low for Sri Lanka, who have now lost four consecutive away Test series.