The battle of Carteia (46 BC) was a minor naval victory won by one of Caesar's lieutenants over a Pompeian fleet that had escaped from Africa to Spain after the battle of Thapsus (47 BC).
The Pompeian fleet was commanded by P. Attius Varus. At the start of the Great Roman Civil War he had been forced to retreat along the east coast of Italy, eventually joining Pompey in Apulia. He had then moved to Africa, where he had held out until King Juba I of Numidia had defeated one of Caesar's armies under Curio. Varus had remained in charge in North Africa until after the battle of Pharsalus (48 BC), when the surviving Pompeian commanders had moved to Africa. Scipio took the overall command, while Varus was given command of the fleet. This meant that after Caesar's victory at Thapsus in February 47 BC Varus was able to escape to Spain, when Pompey's son now led the last remaining opposition to Caesar.
Varus probably based his fleet at Carteia (modern San Roque, near the southern tip of Spain). The battle was fought near this town, and the fleet was certainly based here from that point until the end of the war in Spain, when Cn. Pompey attempted to flee there to reach his ships and possible safety. The battle itself is mentioned in Cassius Dio, although it falls into a gap between the commentaries on the African and Spanish Wars once attributed to Caesar.
The battle was fought between Varus's fleet and some of Caesar's ships under the command of C. Didius. Dio doesn't give us any details of the fighting itself, but it ended with Varus's ships being pursued back into Carteia. They only escaped because Varus managed to get ashore and order anchors to be sunk side by side across the mouth of the harbour. The pursuing ships ran into these anchors, 'as on a reef', and had to abandon the pursuit.
Although Cn. Pompey reached Carteia after the defeat at Munda he was briefly seized by the citizens, who hoped to offer him to Caesar to atone for having resisted him. Pompey managed to escape from this trap, but was soon caught and executed.