The ruling also said that five acres of the land must be given to the Sunni Waqf Board, which represents the Muslims in Ayodhya, for the construction of a new mosque.
The Ayodhya site, where the Babri Mosque was located and subsequently torn down in 1992, is said by Hindus to be the birthplace of the Indian diety Lord Ram. Hindus claim the mosque was built in the 16th century over an ancient temple, a claim that failed to be backed by archaeological surveys.
The decision comes on the same day the Kartarpur Corridor, which gives Sikhs visa-free access to one of their holiest sites, is about to be inaugurated.