Toulouse, Aquitaine and Gascony were again part of the Frankish kingdom. After his victory, Pippin the Short died in 768 and was succeeded by his sons Charlemagne and Carloman. At Pippin's death, Hunald (son of Duke Waifer) staged an insurrection against Frankish power in Aquitaine. Charlemagne intervened, defeating him. In 771 Carloman died, leaving Charlemagne sole ruler of the Frankish realm. In 778, Charlemagne led his army into Spain against the Arabs. On his way back, in Roncesvalles, Charlemagne's rear guard was attacked in the pass by Basque warriors. Realizing that the local populations were not entirely loyal to the Franks, he reorganized the region's administration; direct Frankish government was instituted, and Frankish counts (deputies of the Frankish king) were appointed in cities such as Toulouse.