The Battle of the Pyrenees involved several distinct actions.
On 25th July, Soult and two French corps fought the reinforced British 4th division and a Spanish division at the Battle of Roncevalles. The Allied force successfully held off all attacks during the day, but retreated from Roncevalles Pass that night in the face of overwhelming French numerical superiority.
Also on 25th, a third French corps severely tried the British 2nd division at the Battle of Maya. The British withdrew from the Maya Pass that evening.
Wellington rallied his troops a short distance north of Pamplona and repelled the attacks of Soult's two corps at the Battle of Sorauren on 28th July. Instead of falling back northeast towards Roncevalles Pass, Soult made contact with his third corps on 29th July and began to move north. Soult abandoned the offensive on 30th July and headed towards France, having failed to relieve either garrison.
On 30th July, Wellington attacked Soult's rearguard at Sorauren, driving some French troops to the northeast, while most continued to the north. Soult led his army up the Bidassoa River valley and escaped the British after a final rearguard action at Etxalar on 2nd August.
Wellington at the Battle of Sorauren, 28th - 29th July 1813
[All necessary background for my current story about the Montailhac brothers.]