Queen Samavati had many maids who attended to her every need. Among them was a maid called Khujjuttara whose duty was to buy flowers for Samavati from the florist Sumana every day. One day, Khujjuttara had the opportunity to listen to a sermon delivered by the Buddha at the home of Sumana. Because of her spiritual attainment in her previous lives, the words of the Enlightened One helped her to attain Sotapatti. On returning to the palace, she repeated the sermon to Samavati and her other maids and they also realised the Dhamma. From that day, Khujjuttara did not have to do any major work, but was looked upon as mother and teacher to Samavati. Being an extremely intelligent person, she listened to the discourses of the Buddha and repeated them to Samavati and her maids. So great was her intellect that in the course of time, Khujjuttara even mastered the Dhamma.
Samavati and her maids liked to see and pay homage to the Buddha; but were afraid that the king might disapprove, so they would look at the Buddha by peeping through openings in the palace walls. They paid respects to the Buddha in this manner every time he passed the palace on his way to the homes of other devotees.
At that time, the king had another queen by the name of Magandiya. She was the daughter of a brahmin. The brahmin once decided that the Buddha was the only person who was worthy enough to marry his very beautiful daughter. So, he offered to give his daughter in marriage to the Buddha. Turning down his offer, the Buddha said, 'Even after seeing the most beautiful girls, Tanha, Arati and Raga, the daughters of Mara, I felt no desire in me for sensual pleasures. After all, what is this body which is full of filth?" The Buddha knew from the beginning that the brahmin and his wife had reached the stage of mental purification where they could attain Anagami that very day, hence his reply to the brahmin in the above manner.
On hearing those words of the Buddha, both the brahmin and his wife realised that all beauty is impermanent, and attained the third stage of Sainthood. They entrusted their daughter to the care of her uncle and both joined the Order. Eventually, they attained Arahanthood. But the story does not end there. The daughter, Magandiya, was very proud and she took the Buddha's words as a personal insult. She became very bitter and vowed to take revenge when the opportunity arose.
Later, her uncle presented Magandiya to King Udena and she became one of his queens. Magandiya learned of the arrival of the Buddha in Kosambi and how Samavati and her maids paid homage to him through holes in the walls of their living quarters. She planned to take her revenge on the Buddha and to harm Samavati and her maids. Magandiya told the king that Samavati and her maids had made holes in the walls of their living quarters and were being unfaithful to him. King Udena saw the holes in the walls, but when the matter was explained to him he did not get angry.
But Magandiya persisted in trying to make the king believe that Samavati was not loyal to him and was trying to kill him. On one occasion, knowing that the king would be visiting Samavati within the next few days and that he would be taking along his lute with him, Magandiya inserted a snake into the lute and covered the hole with a bunch of flowers. Magandiya followed King Udena to Samavati's quarters saying she was worried about his safety. At Samavati's place Magandiya removed the bunch of flowers from the hole of the lute. The snake came out hissing and coiled itself on the bed. When the king saw the snake he believed Magandiya's words that Samavati was trying to kill him. The king was furious. He commanded Samavati to stand and all her ladies to line up behind her. Then he fitted his bow with an arrow dipped in poison and shot the arrow. But Samavati and her ladies bore no ill towards the king and through the power of goodwill (metta), the arrow did not hit the target although the king was an excellent archer. Seeing this obvious miracle, the king realised the innocence of Samavati and he gave her permission to invite the Buddha and his disciples to the palace for almsfood and religious discourses.
Magandiya, realising that none of her plots had materialised, made a final, infallible plan. She sent a message to her uncle with full instructions to go to Samavati's palace and burn down the building with all the women inside. As the house was burning, Samavati and her maids advanced in spiritual attainment, continued to meditate in spite of the danger. Thus, some of them attained the second stage of Enlightenment and the rest were also benefited before the palace was gutted with them inside.
As soon as he heard the news, the king rushed to the scene, but it was too late. He suspected that it was done at the instigation of Magandiya but he did not show that he was suspicious. Instead, he said, 'While Samavati was alive I had been fearful and alert thinking I might be harmed by her; only now is my mind at peace. Who could have done this? It must only have been done by someone who loves me very dearly.' Hearing this, the foolish Magandiya promptly admitted that it was she who had instructed her uncle to do this terrible deed. Thereupon the king pretended to be very pleased with her and said that he would grant her a great favour and honour all her relatives. So, the relatives were sent for and they came gladly. On arrival at the palace, all of them, including Magandiya, were seized and put to death in the palace courtyard. Thus, the evil Magandiya was punished for plotting the death of the holy queen and her attendants.