Bastia came from behind twice before seeing off Caen in extra time to reach the quarter-finals for the Coupe de la Ligue.
The visitors opened the scoring with just 12 minutes on the clock when Sloan Privat found the net after getting on the end of a Thomas Lemar cross.
However, Bastia drew level in spectacular fashion on 42 minutes as Guillaume Gillet found the top corner with an unstoppable 25-yard drive.
Caen took the lead again just over 15 minutes remaining thanks to Jose Saez's effort from the edge of the penalty area, but the home side took the game to extra time when Famoussa Kone arrived in the box to fire in.
The Corsicans then sealed their place in the quarter-finals when Benjamin Mokulu found a way past keeper Damien Perquis eight minutes from time to seal victory.