According to Hikayat Merong Mahawangsa or the Kedah Annals, Kedah was founded by a Hindu king named Merong Mahawangsa. According to the text further, the Sultanate of Kedah started in year 1136 when King Phra Ong Mahawangsa
converted to Islam and adopted the name Sultan Mudzafar Shah. However,
an Acehnese account gave a date of 1474 for the year of conversion to
Islam by the ruler of Kedah. This later date accords with an account in
the Malay Annals
where a raja of Kedah visited Malacca during the reign of its last
sultan seeking the honour of the royal band that marks the sovereignty
of a Muslim ruler.[14]