After the sister of the king Mahasena married a person disapproved by the king, she was banned from the palace and the newly married couple went off and established a small farming village around Kaudulla. Meanwhile King Mahasena while building and developing the irrigation systems around the country planned a massive tank at Minneriya to support the agriculture of the area. To carry this enormous amount of water, he had to build an extra long dam. To protect this dam from breaking up by the force of the water the king was asked to make a human sacrifice to the demons/gods who protected dam. The king hearing that his sister has given birth to a son, ordered the chief minister to sacrifice this infant on the gods. But the minister sacrificed a goat instead of the baby and informed the king that the sacrification is complete. The king satisfied, built and completed one of the largest man made tanks in that time.
On the day he was to ceremonially open the floodgates, he started regretting his decision to sacrifice his own nephew. The chief minister then informed the king that indeed infant prince is still alive. The king thrilled at the news ordered his ministers to bring his sister to the tank to show his marvelous creation and to share the joy. The sister was then escorted and was shown this gigantic tank by his brother. Then sister laughed and told the king that she too has been busy and requested the king to follow her to show what she has been up to. The princess took her brother to a new tank, which she had built with the villagers, which was even larger than the Minneriya. This tank is what we now know as Kaudulla Tank.