Wa`alaykumas-salamu wa rahmatullahi wa barakatuh.
In the Name of Allah, Most Gracious, Most Merciful.
All praise and thanks are due to Allah, and peace and blessings be upon His Messenger.
Dear brother in Islam, we are really impressed by your question which shows how concerned you are about what takes place in the world that affects peoples' security and well-being.
Islam is an open call for peace, mercy, security, and compassion. It prohibits its followers to attack civilians in any form. Foreigners and tourists who legally enter Muslim countries are fully protected and safeguarded in Islam. Islam categorically prohibits all forms of violations to their bodies, honor and property. The visa entrance given to tourists and foreigners is considered to be a form of a security pledge or `ahd aman that can't be violated.Muslim scholars state that attacking tourists and foreigners who enter Muslim territories is an impermissible act.
Responding to the question, Sheikh Hussain Halawah, the secretary general of the European Council for Fatwa and Research (ECFR) and imam of the Islamic Cultural Center of Ireland (ICCI) states the following:
The mere entrance of a tourist or a trader or any other foreign citizen into the territories of the Muslim country with a visa is considered to be a pledge of security that is known in Islamic jurisprudence as `ahd aman. In Islam, it is categorically prohibited to violate this pledge of security. Those who enter Muslim territories such as tourists and other categories of people usually enter through the visa or any other legal channel through which they are granted legal access for an interim period, and it is impermissible in Islam to violate the pledge given to them by attacking them, their property, or their honor, et cetera.
It has been authentically reported that many non-Muslims, who had been at war with Muslims in the early days of Islam, used to enter the Madinah after being given the pledge of security for entrance (which is equal to the visa in modern times), and no one ever attacked them. The Prophet (peace and blessings be upon him) is reported to have said, "It is not permissible for a Muslim to terrorize another Muslim" (Al-Bukhari). In their commentary on this hadith, Muslim scholars state that the Prophet did not intend terrorizing Muslims in particular, but the word Muslim was mentioned in the hadith because the context of the situation was that a Muslim terrorized another Muslim and not a non-Muslim.
The Prophet (peace and blessings be upon him) is also reported to have said, "The believer is the one to whom people feel secured regarding their blood and property." (Al-Bukhari) Allah Almighty says, [Whosoever killetha human being for other than manslaughter or corruption in the earth, it shall be as if be had killed all mankind, and whoso saveththe life of one, it shall be as if he had saved the life of all mankind] (Al-Ma'idah 5:32). Muslim scholars state that the ruling in the above verse is applicable to both Muslims and non-Muslims alike.
In addition to the prohibition of such attacks, I also consider them to be a form of maltreating the guests which Islam prohibits. Khalid ibn `Amr relates that he heard the Prophet (peace and blessings be upon him) saying, "He who believes in Allah and the Last Day should honor his guest as he deserves" (Al-Bukhari and Muslim).
Thus, it is our duty as Muslims to honor our guests and to avoid any form of humiliation to them. Such attacks and bombings are surely a humiliation to guests which Islam prohibits.
Moreover, I would like to stress that those who attack non-Muslim civilians in Muslim countries such as those who masterminded the recent attacks in Egypt are either paid agents or else people who are ignorant of the religion of Islam. I am more inclined to consider them as paid agents because if we ponder over the similar attacks and bombings that took place in Egypt in the last two years we will notice that they correspond to certain national events. This gives us the clue that fingers of accusation are pointing at the hidden hands of the enemies of Egypt as well as other Muslim countries who are mainly targeting the security and stability of those countries.
As for the other point concerning the guidelines to be followed by tourists upon entering Muslim countries, I can say that as Muslims are ordered by Islam to secure all means of safety and security for their foreign guests and tourists, it is also required that guests and tourists respect the religious values, local cultures, customs, and traditions of Muslim countries they legally enter. It is worthy stressing here that as Muslims, we are ordered to respect customs and traditions that do run counter to the basic teachings of Islam as Allah Almighty says, [Keep to forgiveness (O Muhammad), and enjoin kindness, and turn away from the ignorant] (Al-A`raf 7:199).
Here, I would like also to add that the violations of religious values, customs, and traditions from the tourists' side can't be taken as justifications to permit killing, attacks, or a violation of the rights of tourists and visiting guests. Above all, it is not permissible to attack them or their properties in any form.
It is the responsibility of the government that grants tourists entrance visas to take all the necessary legal measures that secure the upright behavior of such tourists on its soil. In case the government has taken measures and enacted laws and then laws were violated by visiting guests or tourists, then only a Muslim ruler is permitted to prevent them from staying in the Muslim country. Only a Muslim ruler is permitted — in case of any violation on the part of the tourist — to order their deportation. But killing them or attacking them in any way is categorically prohibited.
Addressing an Islamic conference organized by the Arabic-language satellite channel Iqra, which was held in the Egyptian town of Sharm El-Sheikh in August 2005 after the bloody attacks that hit the city the previous July, the world-renowned scholar Sheikh Yusuf Al-Qaradawi, stated the following:
It is categorically prohibited for a Muslim to kill or attack any person whose country is at war with Muslims as long as such a person is given the security pledge by Muslims. No Muslim is permitted to attack that person in any form. His body, property, and honor are fully secured, even if the one who gave him the security pledge is an individual Muslim. The security pledge given by a single person is as effective as an official state pledge itself and prohibits any violation or cancellation of the individual pledge.
It has been authentically reported that Umm Hani, the daughter of Abu Talib, had given a security pledge to one of her relatives who was a disbeliever. Her brother, `Ali Ibn Abu Talib (may Allah be pleased with him) wanted to kill that person. Umm Hani then went to the Prophet (peace and blessings be upon him) and complained, and Prophet said to her, "I have agreed to protect whom you have protected (i.e. through your security pledge), Umm Hani" (Al-Bukhari and Muslim). Muslim scholars inferred from the above prophetic statement that if a Muslim woman were to give a security pledge, her pledge must be respected. The Muslim state should respect a pledge given by any individual.
Based on this, it is obligatory upon Muslims to protect all foreigners who enter Muslim territories through a Security Pledge as long as they have entrance visas that are customarily given by the state authorities.
Thus, attacking tourists who enter Muslim territories after getting the official approval of state authorities is an impermissible act as such tourists are hosted by Muslims and protected by them. No Muslim is permitted to violate the interim security pledge given to tourists and other foreigners in this regard. The Prophet (peace and blessings be upon him) is reported to have said, "Anyone who kills a dhimmi will not smell the fragrance of Paradise" (Al-Bukhari).
At the same conference, Dr. Salah As-Sawi, secretary general for the Assembly of Muslim Jurists in America (AMJA), stated:
Violent acts inside Muslim countries can be classified as follows:
1. If those violent acts are directed towards non-Muslim citizens inside a majority Muslim country, then such acts constitute a violation to the Security Pledge those citizens are granted. In case there is a violation to the security pledge by any non-Muslim citizen, then heis solely responsible for his personal violation, and no one except the Muslim ruler is allowed to question him for such violation. The issue can't be left for personal intervention as this will surely lead to chaos, sedition, and bloodshed. It is worthy mentioning here that leaving the punishment for violation to persons is prohibited not only in Islam but also in all other religions.
2. If those violent acts are directed towards non-Muslim foreigners, then they are also considered to be an aggression against people who are given the security pledge. This is also forbidden in Islam even if those foreigners are citizens of countries that are at war with Muslims. All pretexts cited by those who justify attacking foreigners in Muslim territories are rejected from an Islamic perspective.
3. If those violent acts are directed towards Muslims, then they are also forbidden. Aggression in this case is targeting innocent civilians which is also forbidden.
4. If violent acts are directed towards liquor stores and other places where vices are openly committed inside Muslim countries, then such attacks are also forbidden. This is because it has been undoubtedly stated that the harms resulted from such violent attacks far exceed their benefits.
5. If violent acts are directed towards destructing public utilities, then they are considered an aggression against public property that is owned by the Muslim state, this is also forbidden. Such destructive acts add to the weakening of the Muslim Ummah, and hence the enemies of Islam seize the opportunity to humiliate Muslims. This becomes evident even if those who carry out such prohibited attacks do not envision the destruction of their violent acts.