Battle of São Mamede The Battle of São Mamede ( , ) took place on 24 June 1128 near Guimarães and is considered the seminal event for the foundation of the Kingdom of Portugal . Portuguese forces led by Afonso Henriques defeated forces led by his mother Teresa of Portugal and her lover Fernão Peres de Trava . Following São Mamede , the future king styled himself " Prince of Portugal " . He would be called " King of Portugal " in 1139 and was recognised as such by neighbouring kingdoms in 1143 . Background . In late 11th century , Henry of Portugal , a knight from Burgundy and descendant of King Robert II , was in search of adventure in Hispania . He fought the Moors along with Alfonso VI of León . In honour of his fights in Hispania , the King gave him the County of Portugal . This gift came with a reinstated title ; because of attempts by the previous holder some years earlier to assert independence , it had been suppressed . Henry became count of Portugal and Theresa , one of Alfonso ' s daughters , his wife . In 1095 , the county was a dependency of the Kingdom of Galicia , itself a dependency of the Kingdom of León . In 1097 Portugal became a direct dependency of León . However , from the early years of his rule , as he became influenced by the desire of the lords of the county for independence , Henry desired the independence of the county . Henry died in 1112 , and his wife " Regina Tarasia " ( Queen Theresa , as she addressed herself ) became the countess of Portugal . She also wished for independence from her sister , Urraca , who became Queen of León after Alfonso ' s death . Like her husband , Theresa was also ambitious . In an attempt to maintain the autonomy of her county , she allied herself to her sister ' s enemies or with her sister , whichever was most propitious at the time . In 1116 , the Portuguese took two Galician cities , Tui and Ourense . In reply , the sister of Countess Theresa , Queen Urraca , attacked Theresa ' s dominions . Bishop Gelmeres , a friend of a Galician noble that was in the service of Theresa , led a revolt in the camp of Queen Urraca , and she was obliged to make peace with her sister Theresa . Urraca died in 1126 . Alfonso VII became king of León and Castile and demanded that Theresa become his vassal , which she refused to do . In response , Alfonso attacked Portugal in the spring of 1127 . This increased the power of her son , because she had lost the trust of the Leonese king , and her son became the count of Portugal . Theresa became a puppet of the Galician Ferdinand Perez de Trava . Theresa and Prince Afonso became enemies , as both wanted to take control of the county , but only the supporters of Prince Afonso were really interested in full independence . Nobles of the foundation of Portugal . Afonso Henriques was not alone in the battle . In fact , he was pressured by the lords of the main Portuguese cities and by the local church and its people to achieve the independence of the county . Nobles participating on the battle with Afonso Henriques : The battle . The counts that dominated the counties of Portugal and Coimbra kept the idea of independence , and their merger strengthened their positions . Alfonso VI of León , knowing the wishes of the Portuguese , united all Galicia under a single rule of one lord , which he choose from one of his close relatives . Teresa , mother of Afonso Henriques , came to Guimarães to govern the Portuguese county . The Portuguese did not accept this , and the battle started . Afonso won the battle and Portugal started its journey towards independence . In 1129 , he declared himself " Prince of Portugal " and in 1139 as " King of Portugal " . León finally recognized Portugal ' s independence in 1143 in the Treaty of Zamora . In 1179 , the Holy See declared him King , de jure .