As the western strip of the Iberian peninsular, the history of the Portuguese Republic was synonymous with that of Spain until recent times, and it was not until 1249 that its borders were drawn up to separate it finally from Spain.
The early years of Roman, Carthaginian, and Berber conquests were followed by the reestablishment of European Christianity but, as it was still a feudal system, independence from Spain it was not easy to establish. It was after the Battle of Ourique in 1139, when the Muslims were defeated, that the fiefdom eventually was recognised as a kingdom, and the subsequent drive south to the Algarve established the country we know today.
Despite ongoing struggles with Spain for dominance, and a period of time under Spain's King, Portugal did become a global power with colonisation, trade and the establishment of bases around Africa and stretching from Brazil to Japan and the Orient.
Napoleon's peninsular campaign fought in part and finally routed under Wellesley, the future Duke of Wellington, was a horrific war for both Portugal and Spain, as portrayed by Goya, but kept up the long standing alliance between England and Portugal which has run from 1373 to the present time.