Bournemouth took the lead in the 21st minute with a fierce right-footed shot from the edge of the penalty area by Stephen Purches, but Gillingham equalised with a spectacular 35-yard strike from Jack Payne eight minutes before the break.
Bournemouth regained the lead in the 59th minute following a goalkeeping error by Gillingham’s Paolo Gazzaniga, who dropped Harry Arter’s free-kick into the path of Stephane Zubar and the hosts looked to have made certain of progress a minute later with an outstanding individual effort from Scott Malone.
Malone ran from deep inside his own half before unleashing a fierce right-footed shot into the roof of the net.
Then came Gillingham’s revival, although it needed another goalkeeping error to set up a thrilling finish. Danny Jackman’s left-footed shot appeared to carry no venom, but it slipped through the hands of Darryl Flahavan to give Gillingham new hope.
Gillingham earned their replay in the final minute of normal time when a long throw from Charlie Lee caused chaos in the Bournemouth defence and Kedwell had time to turn and shoot home from eight yards.