Meanwhile, King Alfonso VII of León regarded the independent ruler of Portugal as nothing but a rebel. Conflict between the two was constant and bitter in the following years. Afonso became involved in a war, taking the side of the Aragonese king, an enemy of Castile. To ensure the alliance, his son Sancho was engaged to Dulce of Aragon. Finally after winning the Battle of Valdevez, the Treaty of Zamora (1143) established peace between the cousins and the recognition by the Kingdom of León that Portugal was a fully independent kingdom.