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 as Afobe was played in by Josh King and fired home to make it 2-0 .
The win lifts AFC Bournemouth to 13th on 33 points, nine clear of the relegation zone.
Swansea’s second consecutive defeat drops them to 17th, three points off the bottom three.