He tried to repair the borders of his kingdom, which had been reduced by the Treaties of Tudején and Carrión, which he had been forced to sign with Castile and Aragón in his early reign. By the Accord of Soria, Castile was eventually confirmed in its possession of conquered territories. In the face of a possible Castilian military takeover of further western Navarrese territories, Sancho VI re-asserted royal authority by founding several towns in 1181, including San Sebastián, Vitoria and Treviño, among others.