Agha scored 107 off 90 balls, helping Pakistan post 305 in 49.5 overs after being asked to bat first.
Sri Lanka fought back through Pavan Rathnayake and Janith Liyanage but were eventually bowled out for 268 in 48.1 overs.
Pakistan endured an early setback as Dilshan Madushanka dismissed Fakhar Zaman for 16 and Saim Ayub for seven to reduce the hosts to 32 for two.
Babar Azam and Saad Baig then steadied the innings with a 74-run partnership for the third wicket.
Babar made 45 off 57 balls before falling to Eshan Malinga, while Baig contributed 39 off 40 deliveries.
Agha took charge after Baig’s dismissal, building crucial partnerships with Hasan Nawaz and Arafat Minhas to lift Pakistan towards a competitive total.
Hasan scored 37 off 49 balls in a 97-run stand with Agha for the fifth wicket.
Minhas added 18 off 15 deliveries, while Agha continued his assault before being dismissed by Asitha Fernando in the 47th over.
Agha’s innings featured 10 fours and a six. Malinga finished with four wickets for 46 runs, while Fernando claimed three and Madushanka took two.
In reply, Sri Lanka lost Avishka Fernando early, but Kamindu Mendis and Kusal Mendis attempted to rebuild the innings. Kamindu scored 44 off 50 balls before Shaheen Shah Afridi removed him, leaving Sri Lanka at 83 for three.
Rathnayake and Liyanage then revived Sri Lanka’s hopes with a 127-run partnership for the fifth wicket. Rathnayake struck 79 off 74 balls, including six fours and two sixes, while Liyanage made 60 off 74 deliveries with five boundaries.
Their dismissals, however, shifted the momentum back towards Pakistan. Afridi removed Rathnayake’s predecessor in the middle order and later dismissed Dasun Shanaka for 28, finishing with three wickets.
Naseem Shah and Haris Rauf claimed two wickets apiece, while Faheem Ashraf also picked up two. Sri Lanka’s lower order could not sustain the chase, and the visitors were dismissed with 11 balls remaining.