Hindus say the small patch of land where it stood is the birthplace of their revered god Ram, and the site has become a symbol of India's Hindu-Muslim divide.
Here are the key dates in the centuries of bitterness leading up to the Indian Supreme Court's ruling on Saturday on who should own the site:
According to devout Hindus, this was when the important warrior deity Lord Ram or Rama, the seventh avatar of Vishnu, is born in Ayodhya in northern India.
After more than a year's work, a mosque to honour Babur, who came from what is now Uzbekistan to conquer northern India, is completed. Nearly five centuries later, the derelict site now covered in weeds and the rubble is considered the epicentre of modern Hindu nationalism.
Hundreds arrested ahead of verdict on India's Babri mosque
The first recorded sectarian clashes over the mosque erupt after Hindu devotees launch protests saying the mosque was built on the birthplace of Rama. Muslims stage their own march on Ayodhya and about 70 die in clashes.
Two years later, another Muslim march on the city is fought back by British and Hindu troops in clashes that leave up to 700 dead.
The mosque is damaged in a communal riot in 1934 after the killing of a cow, an animal many Hindus consider sacred. But it is soon after the subcontinent's 1947 partition into Hindu-majority India and Muslim-dominated Pakistan that Ayodhya becomes a battleground between the two faiths.
On December 22, 1949, dozens of people break into the mosque and set up idols of the gods Ram and Sita. The next day, thousands of Hindus gather outside believing it was a miracle. Federal courts order the idols to be removed, but local courts refuse to enforce the action.
Hindu agitation over Ayodhya grows in the 1980s. In 1986, one radical group launches a campaign to gather bricks for a new temple that draws contributions from across India as well as from supporters in the United States, Canada and Europe.
L K Advani, the leader of the conservative Bharatiya Janata Party (BJP) of current Prime Minister Narendra Modi, leads a procession of Hindus demanding the building of a temple on the mosque site. The Indian army blocks the procession and Advani is arrested. Some 30 Hindus are killed in clashes.
Indian court announces verdict on Babri Mosque
On December 6, some 200,000 Hindu activists gather in Ayodhya. Some climb fences surrounding the mosque. "With pick axes, shovels and their bare hands, they destroyed the mosque in a matter of hours," wrote the US professor Heather Selma Gregg in her book, "The Path to Salvation: Religious Violence from the Crusades to the Jihad".
The demolition sparks nationwide riots in which 2,000 people die. There are also disturbances in Pakistan and Bangladesh.
In February, a train carrying Hindu activists from Ayodhya prior to the 10th anniversary of the demolition catches fire in Gujarat state - where Modi is the chief minister - and almost 60 are killed. Anti-Muslim riots in the state leave more than 2,000 dead.
Gregg says the modern-day violence took on "mythic proportions, symbolising the fall of India and its people to foreign occupiers and the need for liberation of not only Ayodhya but the entire subcontinent and Hindu people everywhere".
A court in Allahabad orders the mosque site to be divided between three Hindu and Muslim groups. All the parties appeal and the Supreme Court stays the ruling.
India’s Supreme Court on Saturday ended the century-old dispute and decided to hand over the historic site of Babri Mosque to Hindus for the construction of a temple.
In a unanimous judgment, the bench has ordered that a temple must be constructed at the disputed site and the Muslims must be compensated with five acres of land at a prominent place in Ayodhya.
COMMENTS
Comments are moderated and generally will be posted if they are on-topic and not abusive.
For more information, please see our Comments FAQ