Imam-ul-Haq’s excellent career-best 151 saw Pakistan to 358 for nine.
That left England with a seemingly challenging target, particularly as they had rested Jos Buttler following his match-winning 110 not out in the second ODI at Southampton on Saturday.
England generally prefer batting first but captain Eoin Morgan decided to give them experience of chasing just weeks away from the World Cup by opting to field first after winning the toss.
Bairstow’s 128 in a score of 359 for four — England’s second highest winning total batting second in an ODI — helped put the home side 2-0 up with two to play in a five-match series.
Test captain Joe Root made 43 as Pakistan became increasingly ragged in the field, England winning with 31 balls — or more than five overs — to spare. Moeen Ali was 46 not out, with Morgan unbeaten on 17.
The only downside for Morgan on Tuesday was that he risked being suspended for a slow over-rate — England took four hours to bowl 50 overs.
But Bairstow and opening partner Jason Roy, who made 76 after Shaheen Shah Afridi dropped an easy chance to catch him at mid-off on 21, shared a blistering stand of 159 inside 18 overs.
The pair took advantage of a good pitch, short boundaries, fast outfield and an inexperienced Pakistan attack — Mohammad Amir was again ruled out with chicken pox — to repeatedly send the ball soaring over the ropes.
“I was really pleased with that hundred,” Bairstow told Sky Sports. “Coming back into English conditions after playing in the IPL (Indian Premier League) was a big change and it’s nice to hit the ground running.”
Morgan added: “Roy and Bairstow were absolutely outstanding and really did set the platform.”
Meanwhile Pakistan captain Sarfraz Ahmed took some consolation from his side’s batting display.
“The way we put runs on the board, I was very confident,” he said. “But the bowling wasn’t quite up to the mark.”
Roy set the tone for England’s reply with a huge straight six off Afridi and flat-batted medium-pacer Faheem Ashraf’s first ball straight back over the bowler’s head for another.
He eventually sliced Faheem to Asif Ali at cover-point, having hit eight fours and four sixes.
Bairstow, dropped on 86 when Faheem could not hold a tough caught and bowled chance off a fierce drive, was severe on anything short and nwent to his seventh ODI hundred off 74 balls, including 12 fours and three sixes.
He eventually fell when he bottom-edged a pull off Junaid Khan into his stumps, with England well on their way at 234 for two in the 29th over.
Earlier, Chris Woakes bolstered his chances of being included in England’s final 15-man World Cup squad with four wickets for 67 runs in a maximum 10 overs.
The Warwickshire paceman reduced Pakistan to 27 for two, a full-length ball having Fakhar Zaman – fresh from a hundred at Southampton — edging to Root at second slip before a sharp off-cutter bowled Babar Azam.
But left-handed opener Imam went to his sixth hundred in 27 ODIs — and first against England — off 97 balls.
The 23-year-old nephew of Pakistan great and selection chief Inzamam-ul-Haq, upped his tempo by driving left-arm quick David Willey for six.
Imam surpassed his previous ODI best of 128 against Zimbabwe at Bulawayo last year before he was bowled, giving himself room, by Curran.