A man fired several shots into the air in front of the Italian consulate in Istanbul on Thursday, reportedly in protest at Pope Benedict XVI's upcoming visit to Turkey.
The man, said to be 26, was immediately arrested.
He reportedly told Turkish police afterwards that he was "protesting against the pope's visit to Turkey".
The pope will visit predominantly Muslim Turkey from November 28 to December 1.
Turkish police sources quoted the gunman as saying during his interrogation: "I would kill the pope with my own hands if I could. I hope that after what I did today, others will protest as well".
The man told police he acted alone and that he was not a member of a fundamentalist group.
Turkish news channel CNN Turk said the man fired three shots into the air in front of the consulate and then threw his gun at the building.
CNN Turk said the man shouted out "happy is the man who can call himself Muslim" and "damn Italy, I'm Muslim" as he threw the gun.
Italy's ambassador to Turkey, Carlo Marsili, was in his car outside the building at the time of the incident.
He told ANSA that the man was seized by Italian Carabinieri policemen and Turkish security officials.
"I couldn't understand what he was saying but it could well have been a protest against the pope's visit. In Turkey, the people identify the Italian embassy with the pope's trip. We get lots of calls asking us for details of the visit," Marsili said.
Meanwhile, the Vatican played down security concerns linked to the pope's visit.
Vatican press office chief Father Federico Lombardi said that "there are no worries about the pope's trip".
He said the Thursday incident was "marginal" and would not affect preparations for the visit.
"We don't believe the case should be given much weight even though it was obviously not a pleasant episode," Lombardi said.
The pope was invited to Turkey by President Ahmet Necdet Sezer and will visit the capital Ankara, Ephesus and Istanbul.
The visit has been overshadowed by recent Muslim fury over controversial comments about Islam made by Pope Benedict during a lecture in September at a German university.
During the lecture, the German-born pope quoted a 14th-century Byzantine emperor who criticised the Prophet Mohammad.
Some of the most heated reactions came from Turkey, where some critics demanded that the pope's trip be cancelled.
Benedict later said on at least four occasions that he deeply regretted the angry reactions his words had caused, saying the quotation did not reflect his own opinion, but he stopped short of the unequivocal apology demanded by many Muslims.
Turkish Premier Tayyip Erdogan will not meet the pope because of a busy schedule which includes a NATO summit and a meeting of Turkey's Supreme Defence Council.
Some Italian observers said the Turkish premier had snubbed the pope but the Vatican stressed on Thursday that it had been aware of possible problems with Erdogan's schedule when arranging the pope's visit.
Lombardi said that "we've known for a long time that there were overlapping appointments and indeed, no fixed date was set for a meeting".
"We are not disappointed because there is no reason to be. We knew perfectly well that the premier had problems organising his schedule... It is absolutely not a snub".
"Wait and see - the pope will throw down bridges," he added.