The kingdom of Tajul Bahri is ruled by Sultan Tajul Arif and a host of able ministers and officials. One day when the king’s officials and courtiers are gathered in court, Sultan Tajul Arif comes in. Apparently he has been only recently blinded while hunting in a forest. The Sultan, taking his place on the throne, asks one of his ministers (wazir) to call in an astrologer (ahli nujum), so that the cause of his blindness as well as a possible remedy may be known. According to the astrologer the Sultan has been blinded because a golden deer (kijanq emas) crossed his path. The cure is a flower known as bunqa bakawali, which grows in the Garden of Bolkis. The garden is almost impossible to reach. Even if the whole population of Tajul Bahri went in search of the flower the chances of getting it are very remote. The only person who can successfully obtain bunga bakawali is Prince Tajul Muluk, son of Sultan Tajul Arif.
Tajul Muluk leaves with his two companions, Ahmad and Muhammad, in search of the magical flower. They soon arrive at a cross‑roads. The three roads facing them lead respectively to a sea of mud, a dark ocean and a sea of fire. They decide that each one will take a different route. Tajul Muluk goes through the sea of fire, while each of his companions agrees to take one of the other routes. Once the prince leaves, Ahmad and Muhammad decide to abandon their journey. They return to the city to enjoy themselves.
Tajul Muluk, having successfully crossed the sea of fire, finds himself before a cave, the home of a gigantic Garuda bird. Attacking Tajul Muluk, the bird tries to eat him but the prince pleads with it and after some time the Garuda leaves Tajul Muluk alone. As soon as Garuda goes in search of food, there arrives before Tajul Muluk a beautiful princess, Garuda’s daughter. Tajul Muluk and the princess, Nurul Ashikin, are attracted to each other. Upon Garuda’s return, they are married.
Tajul Muluk tells his wife, Puteri Nurul Ashikin, regarding his mission ‑‑ that is to search for bunqa bakawali. Puteri Nurul Ashikin believes that Garuda can be of assistance as he is one of those taking care of the flower. As a means of drawing the huge bird’s attention, the two pretend to quarrel, and when questioned by Garuda, they ask Garuda to swear by the Prophet Solomon that he will grant them a favour. When Garuda takes his oath they tell him regarding Tajul Muluk’s search for bunga bakawali. With the assistance of Garuda’s friend, the king of the rats (Maharaja Tikus), who cuts an underground passage to the Garden of Bolkis, Tajul Muluk reaches the garden. Here he finds Puteri Bakawali asleep. Tajul Muluk feels faint. Without wasting any time, however, he takes the princess ring and bunga bakawali. Puteri Bakawali, upon awakening, finds both her ring and the magical flower missing. She is sent by her father, the king of the skies (Maharaja Kayangan) in search of the two missing items. To this end she disguises herself as a man.
Meanwhile Tajul Muluk, now in possession of bunga bakawali, arrives at the junction where he parted from Ahmad and Muhammad, and where they have agreed to meet. Each of them brings with him a flower, and each claims that his flower is the true bunga bakawali. To establish which of the three flowers is the true bakawali, they find a blind man, who is promptly healed by the flower in Tajul Muluk’s hand. Ahmad and Muhammad decide to steal the flower from Tajul Muluk. Persuading the prince to the edge of a lake, they push him into it, in the process snatching the flower from him.
Meanwhile the story turns to a poor couple. One morning when the wife goes to the lake as usual to get some water, she comes across Tajul Muluk. To her enquiry as to why he is in the lake, Tajul Muluk replies that he is a trader and that he has been robbed and pushed into the lake by a band of thieves. The old woman, pitying Tajul Muluk, takes him home with her. The prince is adopted as their child by the poor couple. He begins selling cakes on their behalf.
Ahmad and Muhammad, having acquired bunga bakawali, now in audience before Sultan Tajul Arif. The Sultan’s blindness cured by means of the flower. As a reward he gives the two as much money as they want and also complete freedom of action in his land for forty days and forty nights. The only restriction is that they cannot kill anyone.
During this time Puteri Bakawali, disguised as a young man, arrives before Sultan Tajul Arif, seeking a job. She is given responsibility of the State Treasury, where she works under the assumed name of Shahrat.
Ahmad and Muhammad misbehave themselves and go wandering about in the country. One day they meet Tajul Muluk as the cake-seller but do not recognise him. They eat his cakes until they are absolutely stuffed. They ask for some water, and when Tajul Muluk goes to fetch water for them, they abscond. His foster parents, when they learn from him the cause of his misery, suggest that a complaint be made to the Sultan.
In the palace the poor man presents his case before the sultan. Puteri Bakawali notices her ring on Tajul Muluk’s finger, and she too goes before the Sultan. As Shahrat, she orders that all the doors to the palace be locked, as there is a thief amongst them. She points out Tajul Muluk as the thief, saying that the ring on his finger is a stolen one. The Sultan, surprised, asks who Shahrat really is, and Puteri Bakawali, removing her disguise, relates all the events that have taken place. It is not Ahmad and Muhammad who obtained bunga bakawali, she says. The successful person is none other than the young cake seller. Tajul Muluk reveals his true identity as the son of Sultan Tajul Arif who went in search of the magical bunga bakawali. Realising that Ahmad and Muhammad have cheated him and his son, the Sultan orders them to be punished, but Tajul Muluk urges his father to pardon them.
At that very instant the King of the Skies arrives and the marriage of Tajul Muluk and Puteri Bakawali is celebrated. Soon afterwards, Garuda too comes in bringing with him his daughter, Tajul Muluk’s first wife. The Sultan orders that celebrations be held for the period of forty days and forty nights to commemorate the marriage of Tajul Muluk to both Puteri Nurul Ashikin and Puteri Bakawali.