A Jordanian military officer has been charged with a crime against Spain's historical heritage after being caught carving his name on a wall of the Alhambra.

The Alhambra, a UNESCO World Heritage Site since 1984, is a walled royal palace and fortress, the jewel and symbol of the Islamic Nasrid dynasty, and is considered one of the greatest masterpieces of Arabic architecture anywhere in the world.

The incident occurred on Aug. 13, when the accused, a 36-year-old army officer who was traveling with a delegation sent to Seville by the Jordanian government to purchase a military airplane, took advantage of his trip to Spain to visit the Alhambra in nearby Granada, the regional daily Ideal reported Tuesday.

The officer was surprised while carving his name with a sharp object on one of the walls by a group of tourists, who notified security personnel.

The Jordanian was subsequently arrested, but not before he finished carving his name.

Prosecutors charged him with committing a crime against the nation's historical heritage, punishable by a fine and up to three years in prison.

After his indictment, the officer, who said he was unaware that his action was against the law in Spain, was allowed to go free pending trial.