The Sassanid Empire was weakened after the war of 602-628 against the Byzantine Empire and their defeats at al-Qadisiyyah and Nahavand at the hands of the Caliphate forces effectively ended the empire. Still, representatives of the House of Sasan continued resisting and found allies – the Tang dynasty in China.