Malacca had a well-defined government with a set of laws. On top of the sultanate's hierarchy sat the Sultan and he was an absolute monarch. The earlier Srivijayan concept of kingship that the king's authority to rule was based on legitimate lineage still prevailed, and with the coming of Islam, it was reintroduced with the name daulat (sovereignty). Malacca's legal codes identified four main state officials appointed by the Sultan.[33]

Below the Sultan was a Bendahara, a position similar to that of a vizier, who acted as an advisor to the Sultan. It was the highest-ranking office that could be held by any common people in Malacca. Bendahara was also responsible for ensuring cordial relations with foreign states. Malacca's fifth Bendahara, Tun Perak, excelled in both war and diplomacy. Twice during the reign of Sultan Muzaffar Shah, Tun Perak successfully led Malaccan armed forces in repelling Siamese attacks on Malacca. When Sultan Mansur Shah ascended the throne, acting on Tun Perak's advice, he agreed to dispatch a peace envoy to Siam. Tun Perak also advised the Sultan to marry the daughter of the King of Majapahit, Malacca's traditional enemy.[2]

Next to Bendahara was a state treasurer, called Penghulu bendahari. Later comes the Temenggung which more or less a chief of public police and state security. After Temenggung, a Laksamana's authority is paramount. He was the head of the navy and also chief emissary of the Sultan. He ensured that the Malacca Straits was safe and enforced the Undang-Undang Laut Melaka ('Maritime Laws of Malacca'). Malacca's most prominent Laksamana was the legendary Hang Tuah. At the bottom of this nobility structure is the four Shahbandars ('harbour masters') for the different communities in the port – one focused exclusively on handling the affairs of the Gujarati traders; another was responsible for traders from Southern India, Bengal, Burma and Pasai; a third for traders from Maritime Southeast Asia; and fourth for traders from Annam, China and the Ryukyu Islands. As the Gujaratis were the most dominant, numbering up to 1000 traders, their Shahbandar was regarded as the most important of the four. Lesser titled state officials were also appointed. They were known as the Orang Besar. In addition, a governor called the Mandulika oversaw the administration of appanages and territories annexed by conquest.[33]

The sultanate was governed with several set of laws. The formal legal text of traditional Malacca consisted of the Undang-Undang Melaka (Laws of Malacca), variously called the Hukum Kanun Melaka and Risalat Hukum Kanun, and the Undang-Undang Laut Melaka (the Maritime Laws of Malacca'). The laws as written in the legal digests went through an evolutionary process. The legal rules that eventually evolved were shaped by three main influences, namely the early non-indigenous Hindu/Buddhist tradition, Islam and the indigenous "adat".[33]

Islam and Malay culture

The conversion of the first ruler of Malacca, Parameswara, to Islam was unclear so far with no evidence as to whether he had actually converted. The 16th-century Portuguese writer Tomé Pires explicitly mentioned that Parameswara was succeeded by his son, Megat Iskandar Shah, and that only the latter converted to Islam at the age 72. On the other hand, the Malay Annals noted that it was during the reign of the third ruler Muhammad Shah, that the ruling class and the subjects began accepting Islam. While there are differing views on when the Islamization of Malacca actually took place, it is generally agreed that Islam was firmly established during the reign of Muzaffar Shah.[63]

Islamisation in the region surrounding Malacca gradually intensified between the 15th and 16th centuries through study centres in Upeh, the district on the north bank of the Malacca River. Islam spread from Malacca to Jambi, Kampar, Bengkalis, Siak, Aru and the Karimun Islands in Sumatra, throughout much of the Malay peninsula, Java and even Philippines. The Malay Annals even reveals that the courts of Malacca and Pasai posed theological questions and problems to one another. Of the so-called Wali Sanga ('nine saints') responsible in spreading Islam on Java, at least two, Sunan Bonang and Sunan Kalijaga, are said to have studied in Malacca.[63] The Portuguese apothecary and chronicler at the time of Malacca's fall, Tome Pires, in his Suma Oriental mentions that the rulers of Kampar and Indragiri on the east coast of Sumatra converted to Islam as a result of Sultan Muzaffar Shah's influence and went on to study the religion in Malacca. The Malay Annals also mentions a number of scholars who served at the Malacca royal court as teachers and counselors to the various Sultans. Maulana Abu Bakar served in the court of Sultan Mansur Shah and introduced the Kitab Darul Manzum, a theological text translated from the work of an Arab scholar in Mecca. A scholar by the name of Maulana Kadi Sardar Johan served as a religious teacher to both Sultan Mahmud Shah and his son. In addition to Kitab Darul Manzum, the Malay Annals also mentions the Kitab al-luma' fi tasawwuf ('Book of Flashes'), a 10th-century treatise on Sufism by Abu Nasr al-Sarraj.[64]

Certain elaborate ceremonies that blend Islamic traditions with local culture were also began taking shape during Malaccan era. One of the example was recorded during the reign of Muhammad Shah. A special ceremony was held that marked the celebration of the 27th night of Ramadan, the Laylat al-Qadr. It began with a daytime procession, led by the Temenggung on elephant-back, conveying the Sultan's prayer mat to the mosque for Tarawih performed after the mandatory night prayers. On the following day the Sultan's turban would be carried in procession to the mosque. Similar ceremonies accompanied the grand celebrations of both Hari Raya Aidilfitri and Hari Raya Aidiladha. Apparently Malaccan Malay society had become so infused with the Islamic worldview that on the eve of the fall of Malacca, warriors at the court requested copies of two Islamic heroic epics, the Hikayat Amir Hamzah and the Hikayat Muhammad Hanafiah, to inspire them in battle the next day. These two epics, still read today, tell of heroes fighting in the defence of Islam.[64]

The rise of Malacca as a centre of Islam had a number of crucial implications. Firstly, Islam transformed the notion of kingship so that the Sultan was no longer viewed as divine, but as God's Khalifah (vice-gerent on earth). Secondly, Islam was an important factor in enabling Malacca to foster good relations with other Islamic polities, including the Ottoman Empire, thereby attracting Muslim traders to Malacca.[64] Thirdly, Islam brought many great transformation into Malaccan society and culture, and ultimately it became a definitive marker of a Malay identity.[3][4] This identity was in turn enriched further through the standards set by Malacca in some important aspects of traditional Malay culture, notably in literature, architecture, culinary traditions, traditional dress, performing arts, martial arts, and royal court traditions.[65] Over time, this common Malay cultural idiom came to characterise much of the Maritime Southeast Asia through the Malayisation.