After the death of Sultan Muhammad Syah in 1445, Raja Ibrahim, his son by the Princess of Rokan was appointed as the fourth ruler of Melaka and he was called Sultan Abu Syahid. Tun Ali was made the Chief Treasurer of Melaka with the title Seri Nara Diraja to replace his grandfather Seri Nara Diraja Tun Perpatih Besar. Although Sultan Abu Syahid was the ruler of Melaka, the real ruling power of Melaka was held by Raja Rokan, the cousin of his mother who came to stay in Melaka during the reign of Sultan Muhammad Syah. During this period, Melaka seem to be ruled by Raja Rokan who was always with Sultan Abu Syahid. Owing to this, the senior officials of Melaka disliked Raja Rokan. Raja Rokan prohibited Raja Kassim, the son of the late Sultan Muhammad Syah with Tun Wati to stay in the palace. Raja Kassim was forced to leave the palace and led the life of a fisherman. His uncle, Tun Ali and no one else, really cared about him and protected him against any threat.
As a result, Raja Kassim then conspired with his uncle Seri Nara Diraja against Raja Rokan. Their plan received good response from the people of Melaka who disliked Raja Rokan and Seri Nara Diraja and Raja Kasim tricked the Bendahara of Melaka to be on their side. The attack was carried out in the night at the palace between the followers of Sultan Abu Syahid and the people of Melaka brought by Raja Kasim, the Bendahara and Seri Nara Diraja Tun Ali. During the attack Raja Kasim and Seri Nara Diraja Tun Ali tried to take Sultan Abu Syahid away from Raja Rokan but failed to do so. When Raja Rokan was stabbed by one of the attackers, he quickly stabbed Sultan Abu Syahid in retaliation. As a result, both the Sultan and Raja Rokan were finally killed in the attack in 1447. Sultan Abu Sayid?s death, although not planned beforehand, was an important development in the history of Melaka, because it actually ensured continuity and political stability in Melaka.