The Jagannath Temple in Puri, Odisha has been in existence since time immemorial. Legends say, there used to be a King named Indradyumna and he was a great devotee of Lord Vishnu.
He had originally constructed the temple on a mountain (Nilasaila). Once the temple was built, he travelled to Brahmaloka to invite Lord Brahma to come and consecrate the temple and the Idols but then Lord Brahma was busy meditating which continued for nine yugas, by then the temple got buried in sand and forgotten in time.
One fine day, it was accidentally discovered by King Gelamadhaba and then later it was repaired, restored and completed by King Chodaganga in the 12th century and that is what we see today.
Jagannath Temple, Puri is one of the Char Dhams of Hindus, the other three Dhams being Badrinath, Dwarka and Rameshwaram.