Raja Ahmad should have been the first Sultan of Pahang, instead, his younger brother Raja Muhammad came before him after being banished from Melaka for committing murder in 1470. He was also passed over from accession to the Melaka throne, in favour of a younger half-brother who became Alauddin Riayat Shah of Melaka.[2] This event led to his resentment towards his half-brother in many years to come.[2] Raja Ahmad went into exile in Pahang, later appointed as Sultan in the place of his brother who died in 1475.