Mamallapuram in Tamil Nadu was a busy port under the Pallava rulers as early as the 7th century CE. It is said that fires were lit to guide sailors even in those times. The British used the temple, built around 640 CE by Pallava king Mahendra Pallava, on top of the Mahishasuramardini cave as a light for sailing ships. The Mamallapuram lighthouse was built close by with a circular masonry tower made of natural stone. It became functional in 1904.