The Cherries battled back from 2-0 down at half-time and 3-1 behind with 15 minutes to go, with Nathan Ake's 93rd-minute winner sealing a famous win.
Sadio Mane scored the Reds' opener when he controlled Emre Can's ball over the top, held off Ake and poked home.
The visitors looked in control when Divock Origi went past Artur Boruc and curled home their second from a narrow angle. Bournemouth brought on Ryan Fraser in the 55th minute and that proved to be the turning point of the game. Seconds later James Milner brought him down in the area and Callum Wilson scored the penalty.
Can put the Reds 3-1 up with a 20-yard curling effort but Fraser scored his first Premier League goal when he tucked home after Wilson's cross had hit the heels of Benik Afobe.
Centre-back Steve Cook got Bournemouth level when he controlled Fraser's cross, swivelled and volleyed home.
It looked like the drama was over until the third minute of injury time when Loris Karius spilled Cook's shot and Ake tapped home into an empty net.
Source: BBC Sports