Shree Rama, without wasting a moment, requested Shree Hanuman to travel to Mount Kailash to get a Shivling for the worship. On Mount Kailash, Shree Hanuman saw Shree Shiva in deep conversation with Shree Parvati. Being unable to interrupt, he sat there in Tapascharya.
In the meanwhile the Shubh Muhurth for the Puja was fast approaching. As there was no sign of Shree Hanuman's return, Lord Rama asked Shree Sitamai to fashion a Shiv Ling out of the sand on the edge of the sea. The Ling so fashioned was installed and Shree Rama offered puja and seva to the linga in total devotion, meditating on Shree Shiva in his mind. Shree Mahadev was pleased with the devotion of Shree Rama and granted Shree Rama's wish of Atonement.
Thus the Ling came into being. The assembled Rishis named it Shree Rameshwar or Shree Ramnath and declared that the worship of this Ling will bring peace, even forgiving sins like Brahma-Hatya.
In the meanwhile Shree Hanuman returned with a Shiv Ling from Kailash. Upon seeing that he was late, he was crestfallen. But Shree Rama installed this Ling near the Shree Ramnath Ling and named it Shree Hanumanteshwar. Even today, Shree Hanumanteshwar Darshan is necessarily taken before the Darshan of Shree Rameshwar at Tamilnadu.
Late Shri. Narayan Bhaskar Nayak in his Itihas gives the following account of how the Temple came into being at Lotoulim.
“The ancient people who inhabited Lotoulim, had with them an Image of Shree Ramnath. Everyday, this image was worshiped with Puja and Naivedya. This image would be carried around with them on their travels and now that they had settled in Lotoulim, they desired to establish the image in a temple. In their “devhara” they had an image of Shree Ramnath on a Horse, and a crystal ling. When the temple was established, a Ling of black stone on a pindi, was installed and the crystal Ling was placed before it. The silver image of Shree Ramnath on a horse was used as a “Utsav Murti”. This smaller silver image was used as a Utsav Murti in the Palkhi Procession for a long time till a bigger Utsav Murti could be made.”
Shri. Mitragotri in his book on Goan history opines that the Ling of Shree Ramnath was brought in ancient times to Lotoulim from Rameshwaram.