Up to the Middle Ages, the history of Portugal is inseparable from
that of Spain. Present-day Portugal became a part of the Roman province
of Lusitania in the 2nd century BC. In the 5th century AD control
of the region passed to the Visigoths, and in the 8th century it
was included in the area of Moorish Muslim conquest.
In 997 the territory between the Douro and Minho rivers (now northern
Portugal) was retaken from the Moors by Bermudo II, king of Leσn,
and in 1064 the reconquest was completed as far south as present-day
Coimbra by Ferdinand I, king of Castile and Leσn. The reconquered
districts were then organized into a feudal county, composed of
Portugal later derived its name from the northernmost fief, the
Comitatus Portaculenis, which extended around the old Roman seaport
of Portus Cale (present-day Porto).In 1093 Henry of Bourgogne came
to the assistance of Castile when it was invaded by the Moors. In
gratitude Alfonso I of Castile made Henry count of Portugal.
On the death of Alfonso in 1109, Count Henry, and later his widow,
Teresa, refused to continue feudal allegiance to Leσn. He invaded
Leσn and began a series of peninsular wars, but with little success.
In 1128 his son, Afonso Henriques, rebelled against his mother.
In 1139 Afonso Henriques declared Portugal independent from the
Spanish kingdom of Castile and Leσn, and took the title Afonso I.
Four years later, through the Treaty of Zamora, King Alfonso VII
of Leσn accepted Portugal's sovereignty and Afonso's position as
king. Portugal was recognized as independent by the pope in 1179.
Portuguese culture is closely related to Spanish culture and has
been influenced by the three primary cultures from which it derives:
the Latin, the Visigoth, and the Muslim.