In 591, the Byzantine Emperor Maurice defeated the Persians and recovered much of the remaining territory of Armenia into the empire. The conquest was completed by the Emperor Heraclius, himself ethnically Armenian, in 629. In 645, the Muslim Arab armies of the Caliphate had attacked and conquered the country. Armenia, which once had its own rulers and was at other times under Persian and Byzantine control, passed largely into the power of the Caliphs, and established the province of Arminiya.