The deadlock at Vitality Stadium was broken on 31 minutes when Afobe’s shot was deflected into his own net by Swansea’s Alfie Mawson.
Gylfi Sigurdsson almost levelled before half-time but Artur Boruc clawed away his long-range strike.
Swansea stepped up the pressure as the second half went on but were caught in the 72nd minute when Afobe was played in by Joshua King and fired home to make it 2-0 .
The win lifts AFC Bournemouth to 11th on 33 points, nine clear of the relegation zone.
Swansea’s second consecutive defeat drops them to 17th, three points above the bottom three.