An early Hungarian state was formed in this territory in 895. The military power of the nation allowed the Hungarians to conduct successful fierce campaigns and raids as far as the territories of modern Spain. A defeat at the Battle of Lechfeld in 955 signaled an end to raids on western territories, although they continued into lands controlled by the Byzantine Empire until 970, and links between the tribes weakened. Prince ("fejedelem") Géza of the Árpád dynasty, who ruled only part of the united territory, was the nominal overlord of all seven Magyar tribes. He aimed to integrate Hungary into Christian Western Europe by rebuilding the state according to the Western political and social models.