Portugal's history dates back to the Middle Ages. During the Age of Discovery, Portugal became a world power through its spice and slave trades. However, losses in battles and natural disasters weakened Portugal in the 15th-17th centuries. Portugal established the first global empire and explored the coast of Africa starting in 1419. Through these voyages, Portugal gained great wealth but its empire later declined due to attacks from rival powers and its inability to defend its large network as a junior partner to Spain.