Ayodhya was known as Kosaldesa in the ancient times. The well-known ruling dynasty of this region was the Ikshvakus of the solar clan (Suryavamsha). It has been known that Ikshvakus was the eldest son of Vaivasvata Manu (the founder of Ayodhya). It is also stated in Hindu Mythology that the earth got its name 'Prithvi' from 'Prithu', the 6th king of the line.
Raja Harishchandra, who is known for his love of Truth, Raja Sagar, (who performed the Asvamedha Yajna) and his great grandson Bhagiratha (reputed to have brought Ganga on earth) were the celebrated rulers of Ayodhya. Later, this clan was called 'Raghuvamsa'. The grandson of Bhagiratha, King Dasaratha was the father of Lord Rama, the renowned king of the Hindu epic Ramayana.
Ayodhya was also the capital of Kosala (the kingdom of the celebrated personality of Treta Yuga, Raghava Rama). Lava and Kusa, the sons of Raghava Rama and Sita inherited each half of the Kosala Kingdom with Ayodhya as their capital.