Afonso Henriques, count of Portugal, proclaimed the country's independence in 1139.
In 1143, with the Treaty of Zamora, the king of Leon recognized Portugal's independence.
Afonso's mother, Infanta Teresa of Leon, daughter of King Afonso VI, after becoming widow, ruled the county of Portugal as Queen, recognized as such by the Pope, her sister Queen Urraca of Leon and her nephew.
She signed documents as "Ego regina
Taresia de Portugal regis Ildefonssis filia".
It is a matter of definition. But Denmark is country where the core part of the country has been a monarchy under the same name for the longest period. Even uninterruptedly ruled by the same family (except when they fought each other for the crown)
Kings ruling in Denmark were named in Imperial German sources from around 800. It is not known if they ruled the whole country.
"Gorm The Old" is belived to have united the country before his death in 958. His decendants has ruled the country since, and the Danish Royal Family is the oldest in Europe. https://www.worldstatesmen.org/Denmark.html
United Kingdom consited of various different monarchies since 881 and number of different dynasties. https://www.worldstatesmen.org/United_Kingdom.html
Spain has a very old royal history, but was not united finally until 1556 https://www.worldstatesmen.org/Spain.html
Monaco was part of various monarchies until it became a separate principality in 1297 https://www.worldstatesmen.org/Monaco.htm
What countries in Europe might have the oldest monarchy systems? Monaco? Denmark? England? Scotland? Spain? Is anything known of their origins?