MADRID—A group of Muslims tried to pray inside a Roman Catholic cathedral that was originally a mosque and then scuffled with security guards and police who tried to stop them, a Spanish official said Friday.

Two of the tourists were arrested after the incident Wednesday night in the southern city of Cordoba and a police officer and a cathedral security guard were slightly injured, National Police spokeswoman Rosa Ortiz told The Associated Press.

The Great Mosque of Cordoba was built after the Moorish invasion of Spain in the 8th century. Cordoba is known as the City of Three Cultures because Muslims, Jews and Christians lived there in harmony during medieval times.

The mosque was transformed into a cathedral in 1236 when King Ferdinand III captured the city from the Moors. Since then, except for rare exceptions, Muslim prayer rites have been forbidden inside.

The building still retains exquisite red and white arches and gleaming marble columns from the original mosque. It was declared a UNESCO World Heritage site in 1984, and is one of Spain's most popular tourist sites.

Ortiz said a group of 120 Muslim tourists from Austria entered the mosque Wednesday evening and a handful of them -- six or seven, she said -- started to pray. Security guards told them to stop, but the small group insisted and argued with the guards, so National Police were summoned.

Two of the people praying insisted even then, and got into a shoving match with officers, after which they were arrested for disobeying and threatening law enforcement officers, Ortiz said.

She declined to name them saying only they were men aged 23 and 19. The detainees were to appear before a judge in Cordoba on Friday. Ortiz said had never heard of an incident like this before.

The bishop's office in Cordoba said the larger group had acted in a coordinated and aggressive fashion, but Ortiz downplayed that idea.

Mansur Escudero, a Spanish Muslim leader, said he has been pressing the Catholic church for years to let Muslims pray in the mosque, but to no end.

Over the past few decades exceptions were made, at the request of King Juan Carlos, and members of the Saudi royal family were allowed to pray in the mosque, Escudero, who is president of the Islamic Commission of Spain, told the newspaper El Mundo.

Spain has a Muslim community of about 1 million, out of a total population of 45 million.

The building's official title is the "Mezquita Catedral de Cordoba" -- the mosque cathedral. Escudero said the name should be changed to ex-mosque cathedral.

"Or just cathedral. If it is not a mosque, they should not call it a mosque," he was quoted as saying.

© Copyright 2010 Associated Press. All rights reserved. This material may not be published, broadcast, rewritten, or redistributed.