For many people in the West, Islam is increasingly associated with violence and terrorism. According to a 2007 survey conducted by the PEW Forum, 45 percent of Americans believe Islam is more likely to encourage violence than other religions, up from 36 percent in 2005. Close to a third of respondents use negative words like fanatic, radical and terror to describe their impressions of Islam.

Does increased religious orthodoxy promote violence and intolerance? Our research on the hajj pilgrimage to Mecca suggests this association is wrong. The hajj is one of the most important institutions in Islam and a singular experience for many Muslims.

Our recent study of Pakistani pilgrims shows that while performing the hajj leads to greater religious orthodoxy, it also increases pilgrims' desire for peace and tolerance toward others. And this greater tolerance is not just toward fellow Muslims - it also extends to non-Muslims.

These findings echo the experience of Malcolm X, who drastically altered his views on race after performing the hajj. In a letter from the hajj, he wrote: "We were all participating in the same ritual, displaying a spirit of unity and brotherhood that my experiences in America had led me to believe never could exist between the white and non-white ... what I have seen, and experienced, has forced me to rearrange much of my thought patterns previously held."

The hajj is an inherently communal and international phenomenon, with over 2 million Muslims from all over the world gathering for several days in intense prayer and rituals. Pilgrims interact with fellow Muslims of different races and ethnicities in a religious context. At the hajj, men and women often pray alongside one another, an entirely new experience for many pilgrims.

Our study isolates the impact of performing the hajj using a method common in medicine. When doctors want to test a new drug, they give it to a randomly selected treatment group and compare their outcomes to a statistically similar control group. While social scientists rarely have the opportunity to use this method, we are able to do so by taking advantage of a randomized lottery for allocating hajj visas in Pakistan. We compare the attitudes of 800 successful lottery applicants, the "treatment" group, to an equal number of unsuccessful ones. The results are incredibly revealing.

Pilgrims are more observant of orthodox religious practice even five to eight months after returning from the hajj. They are 16 percent more likely to pray, 26 percent more likely to do so regularly in the mosque, and double their likelihood of non-obligatory fasting. Interestingly, however, pilgrims are less likely to believe and participate in localized religious practices, such as using amulets.

What may be surprising to some is that the hajj makes pilgrims more tolerant of both fellow Muslims and non-Muslims. The experience of diversity on the hajj really does seem to matter: Hajjis have more positive views about people from other Muslim countries and are more likely to believe that different Pakistani ethnic and Islamic sectarian groups are equal and that they can live in harmony. Despite non-Muslims not being part of the hajj experience, these views also extend to adherents of other religions: Pilgrims are 22 percent more likely to declare that people of different religions are equal and 11 percent more likely to state that different religions can live in harmony by compromising over their disagreements.

Paralleling the findings on tolerance, hajjis report more positive views on women's abilities, greater concern for their quality of life, and are also more likely to favor educating girls and women participating in the workforce.

Hajjis are also less likely to support the use of violence and show no evidence of any increased hostility toward the West. They are more than twice as likely to declare that the goals of Osama bin Laden are incorrect, more likely to express a preference for peace between Pakistan and India, and more likely to declare that it is incorrect to physically punish someone if they have dishonored the family. Hajjis also become more sensitive to crimes against women.

While these results are specifically about the hajj, they have broader implications.

The impact of an event like the hajj demonstrates that even deep-rooted attitudes such as religious beliefs and views about other social groups can be changed. While all religions may have radical seminaries or extremist groups that promote an orthodoxy that goes hand in hand with hostility toward outsiders, our study shows this is not an inherent attribute of orthodoxy.

The promotion of tolerance doesn't therefore need to be defined in immediate opposition to religious orthodoxy. There may be ways, as demonstrated in the hajj, to leverage religious beliefs to foster compromise and mutual respect.

There is also a broader lesson about exposure to a diversity of peoples. Although lacking a common language, mixing with others across national, sect and gender lines can help promote tolerance-both toward fellow participants but even more significantly, to those who are not part of the experience.