Tanah Lot is claimed to be the work of the 16th-century Dang Hyang Nirartha. During his travels along the south coast he saw the rock-island’s beautiful setting and rested there. Some fishermen saw him, and bought him gifts. Nirartha then spent the night on the little island. Later he spoke to the fishermen and told them to build a shrine on the rock, for he felt it to be a holy place to worship the Balinese sea gods. The main deity of the temple is Dewa Baruna or Bhatara Segara, who is the sea god or sea power and these days, Nirartha is also worshipped here.
The Tanah Lot temple was built and has been a part of Balinese mythology for centuries. The temple is one of seven sea temples around the Balinese coast. Each of the sea temples was established within eyesight of the next to form a chain along the south-western coast. In addition to Balinese mythology, the temple was significantly influenced by Hinduism.