It is not clear who defeated Harsha or when exactly he was defeated. According to some accounts, Harsha's kingdom was eventually conquered by the Gurjara-Pratiharas, a powerful dynasty that ruled parts of northern and western India during the 8th and 9th centuries. However, other accounts suggest that Harsha's kingdom may have been weakened by internal conflicts and civil war, leading to its decline. It is worth noting that our understanding of Harsha's reign and the events of this period are somewhat limited, as the available historical sources do not always provide a clear and consistent picture. As a result, it is difficult to say for certain who defeated Harsha or what the circumstances of his defeat may have been.