As the Mahabharata tells it
Mahabharata, Adi Parva 216 · 2 min read
Arjuna had broken a promise to his brothers, and as penance he had gone into exile for twelve years. He was to live as a celibate, wandering from one holy place to another.
He came, with a company of brahmins, to the place where the Ganga leaves the mountains and comes down onto the plains. They lit their sacred fires along the bank. Arjuna went down into the river to bathe and to offer water to his ancestors.
He had just finished, and was about to come out, when something took hold of him and pulled him under.
He went down and down, through the dark water, and came up in a palace. It was the house of Kauravya, king of the nagas. In front of him a fire was burning, ready for worship, and beside it stood the one who had pulled him in: a naga princess, beautiful and quite unafraid.
Arjuna, being Arjuna, finished his rites at the fire first. Then he turned to her.
"Who are you," he said, "and why have you brought me here?"
"I am Ulupi," she said, "the daughter of Kauravya. I saw you go down into the river, and I loved you. I have no husband. Stay with me."
"I am under a vow," said Arjuna. "For twelve years I must live as a celibate. My brother the king has commanded it."
"Your vow concerns Draupadi," said Ulupi, "and your brothers. It was made so that you would not disturb them. It says nothing about me."
"It is still a vow."
"Then think of this," she said. "If you refuse me, I will die. You are the protector of those who come to you for help. I am asking for your help. Is breaking a small rule worse than letting someone die?"
Arjuna considered it. He had never lost an argument with a weapon. He found he had lost this one.
He stayed the night with her in the palace under the river. In the morning, as the sun rose, he came up out of the Ganga where his brahmins were waiting, and Ulupi gave him a parting gift.
"Every creature of the water," she said, "will be yours to command. None of them will ever harm you."

The brahmins on the bank had been looking for him all night, afraid that the river had taken him. Arjuna told them where he had been. They were astonished, and then they laughed, and the whole company packed up their fires and went on together towards the Himalayas, with the exile no worse for having lost one argument.
The gem
Mahabharata, Ashvamedhika Parva 79 to 81 · 1 min read
Many years later, after the great war, Arjuna followed the sacrificial horse of his brother Yudhishthira to Manipura. The king there was Babhruvahana, his son by the princess Chitrangada, who came out to greet his father humbly, with gifts.
Arjuna was furious. A warrior's son, he said, should fight him.
Then Ulupi came up out of the earth and stood beside the young king. She was his stepmother, and she told him his father was right. So Babhruvahana fought, and he fought well, and one of his arrows struck Arjuna in the chest and killed him.
Babhruvahana, wounded himself, came to and saw what he had done. He sat down beside his father's body and swore that he would not eat again, but would sit there until he died. Chitrangada wept over her husband and turned on Ulupi in anger, and she too swore to fast to death if Arjuna did not rise. Ulupi said nothing to her. She thought of a gem, a jewel of the nagas that brings dead serpents back to life, and it was in her hand. She gave it to Babhruvahana and told him to place it on his father's chest.
Arjuna opened his eyes as if he had been asleep. He saw his son and his two wives around him, and the naga princess from the river, and asked what she was doing in Manipura.

Then Ulupi explained. In the war, Arjuna had brought down Bhishma by shooting at him from behind Shikhandi, whom Bhishma would not fight. Bhishma's brothers, the eight Vasus, had sworn to curse him for it. Her father had pleaded with them, and they had agreed on one condition: the curse would be lifted if Arjuna were killed by his own son.






