England bounced back from Monday's mauling in the series opener with an excellent 65-run success in Dambulla.
The tourists recovered from a poor start to their innings to post 234-8, Middlesex batsman Owais Shah the star turn with 82 off 92 balls.
Their total proved too much for the hosts, who never managed to recover under the floodlights after slipping to 38-4.
The win is England's first on Sri Lankan soil since 1982 and also ends a run of seven straight defeats to Mahela Jayawardene's side that spans back to last summer.
Once again the surface at the International Stadium was not conducive to big scores, and skipper Paul Collingwood had little hesitation in choosing to bat first after winning the toss.
He may have regretted his decision when the top order once again failed to fire, Alastair Cook the first to go for just a single when he was caught at first slip in Chaminda Vaas' second over.
Ian Bell threatened to get going with three crisp boundaries only to depart lbw for 18, while Phil Mustard reached 28 before spooning a simple catch to cover trying to work the ball to fine leg.
When Kevin Pietersen was dismissed for a tortuous 12 made off 41 balls, the tourists were facing the prospect of being bowled out cheaply for the second time in four days.
However, from a perilous position of 61-4, Collingwood and Shah combined in a stand of 78 that was eventually broken when the England captain fell for 42.
Ravi Bopara did fall in the very next over but Swann - once again getting the nod over Monty Panesar - showed his all-round value to the team with 34.
He put on 70 with Shah, who hit only five fours in his 92-ball innings that was eventually ended in the final over by a fine diving catch by Chamara Silva at cover.
Sri Lanka's innings followed a similar pattern as early wickets tumbled, Ryan Sidebottom picking up two, including the key scalp of Sanath Jayasuriya as the veteran opener managed to make just 10 in his 400th ODI appearance.
Stuart Broad came on and had an immediate impact, dismissing Kumar Sangakkara, who had already been dropped twice behind the wicket, and Silva in quick succession.
Jayawardene eventually found an able ally in Tillakaratne Dilshan, the duo sharing a 52-run stand in just eight overs.
But, just as the game seemed to be shifting towards Sri Lanka, Swann produced a beauty to bowl Dilshan, the ball drifting away from the right-hander and then spinning back through the gate.
Collingwood removed his opposite number in the next over to tilt the balance even further in favour of his team.
Despite a valiant 44 not out from Jehan Mubarak, who shared a stubborn last-wicket partnership of 43 with Dilhara Fernando, England sealed a much-needed victory that leaves the series perfectly balanced heading into Sunday's third encounter.