After the downfall of the Gupta Empire in the middle of the 6th century, North India was split into several independent kingdoms. The northern and western regions of India passed into the hands of a dozen or more feudatory states. Prabhakara Vardhana, the ruler of Sthanvisvara, who belonged to the Pushyabhuti family, extended his control over neighbouring states. Prabhakar Vardhan was the first king of the Vardhana dynasty with his capital at Thaneswar. After Prabhakar Vardhan's death in 605, his eldest son, Rajya Vardhana, ascended the throne. Harsha Vardhana was Rajya Vardhana's younger brother. This period of kings from the same line has been referred to as the Vardhana dynasty in many publications.
Rajya Vardhana’s and Harsha’s sister Rajyashri had been married to the Maukhari king, Grahavarman. This king, some years later, had been defeated and killed by king Devagupta of Malwa and after his death Rajyashri had been cast into prison by the Victor. Harsha's brother, Rajya Vardhana, then the king at Thanesar, could not stand this affront on his family, marched against Devagupta and defeated him. But it so happened at this moment that Shashanka, king of Gauda in Eastern Bengal, entered Magadha as a friend of Rajyavardhana, but in secret alliance with the Malwa king. Accordingly, Shashanka treacherously murdered Rajyavardhana. On hearing about the murder of his brother, Harsha resolved at once to march against the treacherous king of Gauda and killed Shashanka in a battle. Harsha ascended the throne at the age of 16.