Saeed Ajmal, the spinner who will play for Hampshire later this year, collected his best ever one day international bowling figures for Pakistan today – but his country still lost to arch rivals India after a dramatic collapse.

Pakistan slipped from 144 for six to 157 all out as India snatched victory in the final one-day international to avoid a series sweep against their rivals.

Pakistan appeared set to complete the whitewash after bowling India out for 167 in Delhi and then getting solid contributions from Misbah-ul-Haq and Nasir Jamshed to close in on their target.

Although fellow opener Kamran Akmal went for a duck and Younis Khan soon followed for six, Jamshed kept his cool to make 34 before being trapped lbw by Ravichandran Ashwin.

Misbah helped the score along to 113 before departing for 39, caught by Ajinkya Rahane off Ashwin in the slips.

Pakistan endured a brief wobble with Shoaib Malik managing only five and Umar Akmal then stumped by Mahendra Singh Dhoni for 25, leaving the tourists on 125 for six.

Mohammad Hafeez and Umar Gul steadied the ship and looked to have them in a winning position with a little over 10 overs to go, but when Gul fell for 11, it prompted a late collapse with Saeed Ajmal following six balls later for one and Junaid Khan run out without scoring.

With seven balls left and Pakistan still 11 shy of their target, Hafeez was caught by Yuvraj Singh at short mid-wicket to give Ishant Sharma his third wicket and wrap up the victory for India.

Earlier, Ajmal – who has been signed to play for Hampshire in the closing weeks of the 2013 season - had dominated proceedings, taking five for 24 as the hosts were dismissed in 43.4 overs.

Dhoni, with an unbeaten century and half-century in the first two games, top-scored with 36 as he hit out with wickets falling regularly around him.

Mohammad Irfan did the early damage as he removed openers Rahane and Gautam Gambhir with just 29 runs on the board.

Rahane went for 19 when he was caught behind by Kamran Akmal after Irfan had taken a slight edge with a ball which was angled across the batsman.

Gambhir had contributed 15 when he was caught by Umar Akmal to become Irfan's second victim, guiding a short and wide delivery straight to point.

Virat Kohli was dismissed for seven when Junaid found an outside edge to give Younis a low but comfortable catch at second slip, leaving the home side on 37 for three.

India had reached 63 when Yuvraj was squared up by a straight delivery from Hafeez and was bowled for 23.

India were battling their way back into the game and Dhoni, playing despite a sore back, hit successive sixes off Hafeez.

However, Suresh Raina went for 31 when he was trapped lbw by Ajmal to leave India on 111 for five.

Ashwin went first ball, again lbw to Ajmal who was on a hat-trick with the final ball of his over.

Ravindra Jadeja played a forward defensive to deny Ajmal a hat-trick but he had still bowled a double-wicket maiden to rock India, who were struggling on 111 for six.

Dhoni responded with a six off the first ball of Hafeez's next over but perished for 36 when he was caught by Umar Akmal at point off Gul.

Bhuvneshwar Kumar was dismissed for two, trapped lbw by Ajmal with a doosra, to leave the home side 141 for eight.

Jadeja and Sharma had put on 19 for the ninth wicket when Sharma was out for five, caught and bowled by Ajmal who took the catch at the second attempt.

Ajmal secured a five-wicket haul when he tempted Jadeja to try for a second-successive six and he was caught at long-on by Umar Akmal after contributing 27 to a disappointing Indian total.