In 628 the empire secured a peace treaty and recovered all of its lost territories.