Guimarães is known as the "birthplace" of the Portuguese nation. It witnessed the birth of Prince Afonso Henriques and was part of several events that led to the Independence of Portugal. But its history goes back even farther. It was inhabited before the Romans.
In the 10th century the Countess of Mumadona, a relative of the King of Leon, built the castle in defence of attacks from the Moors and the Normans. Count Henrique, when he married Teresa, enlarged the castle and established his Courts of Condado Portucalense here.
In 1127 Afonso 7th of Castile laid siege to the Castle to force his cousin, Prince Afonso Henriques, to pledge vassalage to himself. The powerful castle and the discontented nobility from the Douro and Minho rebelled. Queen Teresa marched on Guimarães to suppress the rebellion and the Battle of S. Mamede ensued. The followers of Afonso Henriques won and expelled the forces of his mother, Queen Teresa.
Guimarães was elevated to a city in 1853 by Queen Maria II. Today it is a great modern industrial centre.
The city of Guimarães is like no other city in Portugal. Its past is so intimately intertwined with the History of Portugal that it is commonly and proudly referred to as the Cradle of the Nation. Tradition has it that the boy who would one day be crowned the first King of Portugal in 1179 was born and baptised in Guimarães in 1111. Guimarães played an important role as the major municipality, or villa, during the time of the Condado Portucalense, the name given to the feudal lands between the Lima and Ave Rivers under the rule of the Kings of León (Spain). Guimarães was said to be the site of the Battle of São Mamede, which gave victory to the young Dom Afonso Henriques, thus enabling him to gain independence for the Condado Portucalense from the Kingdom of León. This paved the way for the founding of the Portuguese Nation. The birth of Guimarães can be traced to its formal designation as a town, or villa. The original name was Vimaranes, which is thought to mean belonging to Vimara or Guimara, this being a Germanic name of one of the area's first lords. Over the centuries, the word evolved, via the Latin language, into the version we know today, yet the word Vimaranense has been kept as the term used to call the residents of Guimarães. In the 10th century, the Countess Mumadona Dias, aunt of King Ramiro II of León and widow of Count Hermenegildo Gonçalves, ordered the construction of a convent in her native town of Vimaranes. This religious site became a focus of great attraction and devotion on the part of the populace, and for its defense, a castle was built between the years 959 and 968. In the 11th century, King Afonso VI of Castile and León handed over the governance of the Portucalense Province to Count Dom Henrique, where the latter came to live with his wife, Dona Teresa, the illegitimate daughter of Afonso VI. From this marriage came a son, born in 1111, the boy who would become the first King of Portugal, Dom Afonso Henriques. Before Count D. Henrique died in 1114, he succeeded in obtaining for the villa Vimaranes special royal privileges for its residents. On the 24th of June, 1128, the Battle of São Mamede took place, some historians claiming it was fought in the area known as the Field of São Mamede adjacent to the Castle of Guimarães. The battle brought together the forces of Dom Afonso Henriques, who favoured independence from the Kingdom of León, against those of his mother, D. Teresa and her ally, Count Peres de Trava of Galicia (Spain). The battle was won by D. Afonso Henriques, thus planting the seed for Portuguese Nationhood. In 1179, Afonso Henriques was granted the title of King of Portugal by Pope Alexander III in Rome. In the 12the century, the convent founded by the Countess Mumadona was declared a Chapter House, and it grew in importance and prestige due to the grants and gifts bestowed on it by kings and noblemen alike. Over the centuries, Guimarães has supported various commercial industries, such as cutlery, the spinning and weaving of linens, tanning and leatherworking and silversmithing. Devotion to the Virgin Nossa Senhora da Oliveira has made the town an important pilgrimage destination. Using the Convent and the Castle as anchoring points, walled fortifications were built for the defense of the city, and a main street the Rua de Santa Maria served as the artery between them. Around these two institutions sprang up many streets and buildings inside the walls, thus creating an architectural core that has remained basically unchanged since the 15th century. With the arrival of the Dominicans and the Franciscans, who established their religious orders outside the walls, came a greater expansion of the city. In 1853, Queen Dona Maria II elevated Guimarães to the rank of city, and shortly after that, various sections of the battlements were taken down. Other sections of the ancient walls may still be visited today.