Kamran Akmal smashed an unbeaten 92 off 50 balls as Pakistan came from behind to defeat India by five wickets in a warm-up match for the World Twenty20 on Monday.
Pakistan, chasing India's commanding 185-3, appeared to be out of contention when they lost five wickets by the 12th over with just 91 runs on the board at the Premadasa stadium.
But Akmal and former captain Shoaib Malik turned the game around with a brilliant unbroken stand of 95 off 46 balls that helped Pakistan beat the shell-shocked Indians with five balls to spare.
Akmal plundered six sixes, including the winning shot off seamer Irfan Pathan which sailed over the cover fence. Malik remained unbeaten on 37 off 18 balls.
Virat Kohli had earlier top-scored for India with 75 not out, while off-spinner Ravichandran Ashwin claimed four wickets for 23 runs.
Some 3,000 Sri Lankan fans watched the arch-rivals battle out in the middle in the only warm-up match to be beamed live by the host broadcasters of the World Twenty20 that opens on Tuesday.
"We knew that if India could post a huge total, so could we," said Pakistan captain Mohammad Hafeez. "Kamran was exceptional, and Malik's experience also helped."
Indian captain Mahendra Singh Dhoni said the batting worked well, but the bowlers needed to contain runs on the easy-paced wickets.
"It was not really a bad game for us," he said. "We have got to work on a few things with our bowling."
India and Pakistan are drawn in different groups for the preliminary league, but are seeded to meet in the Super Eights round in Colombo on September 30.
In other matches, England beat Australia by nine runs, Ireland pipped Bangladesh by five runs, the West Indies slammed Afghanistan by eight wickets and South Africa overcame New Zealand by nine runs.
Reigning champions England piled up 172-6 after being sent in to bat, with opener Alex Hales top-scoring with 52 off 38 balls. Luke Wright hit a 29-ball 35 and Eoin Morgan scored a brisk 30 from 16 balls.
Australia managed only 163-6 in reply against the tight England bowling despite a polished 71 off 51 balls from Michael Hussey, who hit five sixes.
England, who take on Afghanistan in their opening match in Colombo on Friday, play another practice match against Pakistan on Wednesday.
A middle-order collapse saw Bangladesh go down to Ireland despite Shakib Al Hasan's hurricane 52 from 23 balls that was studded with three fours and five sixes.
Ireland made 164-6 after being asked to take first strike, with Paul Stirling hitting a 41-ball 71 with five fours and as many sixes. Ed Joyce scored 39 from 36 balls.
Shakib and Tamim Iqbal (35) took Bangladesh to a comfortable 105-2, before four wickets fell for 21 runs to allow Ireland to bounce back.
West Indies opener Chris Gayle warmed up for the tournament with an unbeaten 65 off 48 balls as the West Indies eased past Afghanistan's modest 122-7 in the 16th over.
New Zealand skipper Ross Taylor hammered seven sixes in an unbeaten 75 from 42 balls, but could not prevent South Africa from carving out a nine-run victory.
South Africa rode on captain AB de Villiers' 54 to make 186-6 before four wickets from Dale Steyn restricted the Black Caps to 177-8.