Around 896, the Magyars invaded the Carpathian Basin and by 902, they occupied its whole territory. The Magyars made several raids to the territories of present-day Italy, Germany, France and Spain and also to the lands of the Byzantine Empire. The regular raids contributed to the differentiation of the tribal society because the leaders of the military actions were entitled to reserve a higher share of the booty for themselves. The military actions also contributed to the formation of the retinues of the heads of the tribes and the clans. The Magyars were obliged to stop their regular military actions westwards following their defeat at the Battle of Augsburg on the Lech River in 955; and in 970, the raids against the Byzantine Empire also finished.