By Katya Adler
BBC correspondent in Granada
When the Muslim community in the southern Spanish city of Granada built a new mosque this summer - the city's first for 500 years - it was to considerable local opposition.
During eight centuries of Moorish rule, Granada had enjoyed a reputation for religious tolerance. The Alhambra Palace was once the symbol of Islamic power in Europe.
But that was several centuries ago.
Suspicion and resentment over the new mosque have faded
In the post-11 September world, people said, they feared the mosque could become a focus for religious extremists.
Certainly the yearning for a return to the cherished province of Al-Andalus (Spain's southern region of Andalucia) is often the subject of Islamic poetry.
For many Muslims, the territory is a cherished symbol of Islamic learning and culture.
'Nothing to hide'
But thanks to the open-door policy of Granada's new mosque, local suspicion and resentment has begun to melt away.
"We invite school groups, tourists... anyone who is interested to come by and visit us. We also offer free classes in Arabic for children," mosque director Abdalhasib Castineira told me as we walked through the mosque's garden with its breath-taking view of the Alhambra.
"We have nothing to hide and welcome outside interest in our faith and our culture.
"I believe this is the way forward for Muslims all over the Western world. There is too much ignorance and prejudice on all sides. The threats and the hatred will only fade away if we all educate ourselves more about different faiths and customs."
Yet there is a secret to Granada's success.
Glorious reminders of its Moorish history are everywhere.
The new mosque has been built high on a hill in the Albaicin, Granada's charming old town. Its winding, white-washed streets and many Arabic tea-shops are more evocative of Rabat than Madrid.
Jeronimo Paez, the president of the League of Andalucia and a Granadino by birth, says that the people of Granada are aware that their cultural heritage is mixed, regardless of their religious faith.
"Our passports may say 'Spaniard' but in our hearts we are also Arab," he told me.
"Granada is a city where churches are built next-door to mosques."
This is certainly true of the new mosque, built next-door to Granada's oldest church.
"If we travel to Cairo or Rabat - we feel quite at home," he adds, "similar architecture, similar food, similar temperament."
But just as Moorish rule in southern Spain was not always quite as liberal and tolerant as some historians suggest, the day-to-day realities in modern Granada also present problems as people from different cultures try to co-exist.
It is the job of the city's influential Association of Neighbours to solve them.
"The balancing act between Granada's various communities is not always an easy one," says its president Alberto Sanz.
"In our city's history there was a bloody struggle between Moors and Christians over this territory. In those days people said whoever held the key to the gates of Granada would be master of the city.
"These days the key is a metaphorical one. It's patience, open-mindedness and good will. That is the key to peaceful co-existence and to modern Granada's success."