The city's Hindu population, who believe the site is the birthplace of the god Rama, rejoiced after the verdict
Residents of Ayodhya scrambled for emergency food when India's Supreme Court warned it would soon hand down a final verdict on a holy site that provoked some of the country's worst sectarian violence.
Saturday's ruling gave Hindus the right to build a temple in the city, on land where a five-century-old mosque had stood until religious zealots tore it down in 1992, sparking riots that killed 2,000 people -- mostly Muslims.
"When the news broke on Friday night that the Supreme Court would give its verdict, no-one knew what will happen. Everyone stocked up in case there was violence," said Janaka Lal Gupta, a 60-year-old Hindu who sells religious statues in the city of 450,000 people.
The price of vegetables and other staples skyrocketed in the local market as security forces took over the city ahead of the ruling, but the feared storm did not come.
"It is finally over. Now there won't be any more security lockdowns or sleepless nights," Gupta told AFP.
The city's Hindu population, who believe the site is the birthplace of the god Rama, rejoiced after the verdict.
Houses and shops were decorated with the candles and oil lamps usually reserved for the religion's Diwali light festival.
"I never thought I'd live to see this day," said Ram Pyari, a frail 80-year-old who owns a cosmetic shop.
"I remember the curfews, violence and fighting from my years growing up in Ayodhya. Hopefully the future will be different," she added.
India's minority Muslim community were disappointed with the decision of the court, which also instructed the government to find an alternative site for a "prominent" new mosque.
Muslims across the country feel increasingly isolated under Hindu nationalist Prime Minister Narendra Modi, who has campaigned for years for a temple at Ayodhya.
- 'People have matured' -
But Modi took a conciliatory stance even before the verdict was announced, saying the decision was not "a matter of victory or loss" for any side.
Hindus and Muslims in Ayodhya said they hoped to move on from the decades-old dispute.
"All Ayodhya locals were anxious about the verdict," said Mohammad Saleem, a 48-year-old Muslim beltmaker.
"But it's a good judgment. People should finally be able to move away from whether it should be a temple or a mosque and focus on changing their lives and India's economy."
Ayodhya is one of the holiest pilgrimage sites for Hindus but the local economy is dependent on religious tourism and the city has suffered from the negative publicity caused by the 1992 mosque demolition.
Local infrastructure is dilapidated, with crumbling houses and temples lining the city's main boulevards.
"A grand temple will be a boon for every person in the city and put us back on India's pilgrimage map," Shubham Maheshwar, a student living close by the temple site, told AFP.
During the 1992 rioting and subsequent periods of tension, the city's inhabitants spent long days locked up in their homes fearing unrest outside, said 70-year-old shopkeeper Nand Lal Gupta.
"For months, we were dependent on government rations. As there was no violence now, it shows that people have matured and things will finally improve," he added.