With the departure of the Roman Legions in the early 5th century, the now-unprotected territory was invaded and colonised by the Anglo-Saxons. By the 6th century, the majority of the modern county was part of the East Saxon kingdom. This relatively short-lived kingdom collapsed in the 9th century, ceding the territory of Hertfordshire to the control of the West Anglians of Mercia. The region finally became an English shire in the 10th century, on the merger of the West Saxon and Mercian kingdoms.