Yama took the form of a samnyasin and was the indirect cause for the death of Rama and Lakshmana.
After Rama had killed Ravana in the Lanka war, the main reason for the incarnation of Vishnu as Rama was fulfilled. There needed to be a cause for Vishnu to return to Vaikuntha (his heavenly abode). Brahma asked Yama to go to see Rama. Yama went to see Rama in the guise of a samnyasin called Atibala and said that he had a secret to tell Rama. During their meeting with him nobody was to enter. Lakshmana was asked to guard the entrance, and if anybody entered Lakshmana would forfeit his life.
At that time sage Durvasa approached Rama’s tent, after doing austerities (tapas) for a thousand years. He was hungry and wanted to ask Rama for food. When Lakshmana asked him to wait for a while, Durvasa threatened to turn everybody into ashes if he was not allowed to go inside. With no other alternative Lakshmana had to go inside and inform Rama about the situation. Durvasa was given sumptuous food. But in order to keep the promise with Atibala, Lak- shmana had to die. He went to the river Sarayu and drowned himself. Beset by despair, Rama entrusted the affairs of his kingdom to others and went to the river Sarayu. There he renounced his earthly body and also drowned himself— returning to Vaikuntha in his original form of Lord Vishnu. (Another Puranic version is given in the entry on Lakshmana.)