In Ramayana, it is written that, Manu, the lawgiver of the Hindus, founded the ancient city of Ayodhya. For a long time, over centuries, Ayodhya remained the capital of the descendants of the Surya Dynasty. Of this dynasty, Lord Rama, the 7th incarnation of Lord Vishnu was the most celebrated king. In Atharvaveda, it has been stated that Ayodhya is a `city built by gods`. It also compares the opulence of Ayodhya with the glory and splendor of Paradise itself.
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.