The Cherries made it three wins in a row to move on to 38 points, 13 clear of the relegation zone, and surely guarantee another season in the top flight.
Goals from Max Gradel and Josh King twice put Bournemouth ahead, only for Modou Barrow and Gylfi Sigurdsson to peg them back.
But Swansea could not recover a third time after defender Cook nodded home with 12 minutes remaining.
The Swans, again without head coach Francesco Guidolin on the touchline as he recovers from a lung infection, should also be safe but an eight-point gap means there could yet be a few nervous weeks to come.
Bournemouth could have been three up after only 15 minutes but King headed Gradel's cross over and then blazed too high from 15 yards.
Moments later the hosts were awarded a free-kick on the corner of the area and Andrew Surman's shot came back off the post.
The Cherries took a deserved lead after 37 minutes when Adam Smith burst down the right and drilled in a low cross.
Lukasz FabianksI got a hand to it but could only parry the ball to the feet of Gradel, who crashed it back past him into the net.
It was Gradel's first goal for Bournemouth and a sweet moment for the winger, who suffered a cruciate ligament injury in only his fourth game for the club and was sidelined for six months.
But within two minutes Swansea were level after Barrow was allowed to cut into the penalty area, tip-toe past a couple of half-hearted challenges and fire across Artur Boruc into the corner of the net.
Five minutes after the interval Bournemouth went back ahead after Leroy Fer gave the ball away in midfield.
Gradel charged forward before playing the ball through to King, who rifled it inside Fabianski's near post for his fifth goal of the season.
However, Sigurdsson levelled again in the 62nd minute thanks to a fine run and cut-back from Barrow, the midfielder turning in the area and thumping the ball past Boruc for his seventh goal in 11 matches.
Swansea almost went ahead when another low cross from the impressive Barrow flew behind the Bournemouth back-line, but Boruc made a fine block from the lurking Alberto Paloschi.
Instead Bournemouth secured back-to-back home victories for the first time this season when Cook rose highest to meet Matt Ritchie's cross and powered his header home.
'We are staying up' was the chant around Dean Court as the final whistle approached, and it certainly looks that way.
Source : PA