Cooper Neill for The New York Times
GARLAND, Tex. — One was an extrovert drawn to basketball as well as to Islam, who had been identified by the F.B.I. as a jihadist terrorism suspect and was once a regular at Friday Prayer at a mosque near his Phoenix apartment. The other was more quiet, ran a carpet cleaning business in Phoenix and often prayed at the same mosque, sometimes accompanied by his young son.
It is still not entirely clear what led the two men — Elton Simpson, 30, and Nadir Hamid Soofi, 34, who lived in the same apartment complex in Phoenix — to come to this Dallas suburb and open fire Sunday outside a gathering that showcased artwork and cartoons depicting the Prophet Muhammad.
The shootout — during which Mr. Simpson and Mr. Soofi, dressed in body armor, fired assault rifles at police officers — left both of them dead.
What has become clear, however, is that what took place in a suburban Texas parking lot near a Walmart has pointed up the volatile tensions between the West’s embrace of free expression and the insistence of many Muslims that depiction of the Prophet Muhammad is a sacrilege. It served as a grim reminder of the attack 16 weeks ago on the Paris offices of the Charlie Hebdo satirical newspaper.
In this case, unlike in the massacre of journalists and cartoonists in Paris in January, only the gunmen were killed. Mr. Simpson and Mr. Soofi were shot to death by a Garland traffic officer who was part of a beefed-up security presence outside the Muhammad Art Exhibit and Contest, where artists were offered a $10,000 top prize for the best caricature of the prophet.
It immediately set off a heated debate over art and activism as organizers of the art exhibit said they intended to celebrate free speech. Pamela Geller, an organizer of the event, said it was held at Curtis Culwell Center here because members had heard that a Muslim group had a conference in the same room after the attack on the Charlie Hebdo office.
She described Sunday’s event as pro-free speech, and said that Muslims had become a “special class” that Americans were no longer allowed to offend.
Muslim and religious advocates, while denouncing the violence, called the show an offensive effort to insult Muslims. “The so-called ‘Muslim Art Exhibit’ where the shooting took place is an event deserving of criticism even absent yesterday’s violence,” said Rabbi Jack Moline, executive director of the Interfaith Alliance in Washington.
The two men who opened fire seemed to embody the contradictions of radical Islam and suburban America. Mr. Soofi once owned a pizza and hot-wings restaurant called Cleopatra, and he drifted away from the mosque while trying to run it.
Mr. Simpson, an American-born convert to Islam who was adored by the young men who frequented the Islamic Community Center in northwest Phoenix, was convicted in 2011 of lying to F.B.I. agents — denying that he had made plans to travel to Somalia when in fact he had. Federal prosecutors charged that he wanted to go “for the purpose of engaging in violent jihad,” but a judge ruled that the government had not proved that part of the charge, and sentenced him to three years’ probation.
The F.B.I. and the police in Phoenix opened a new investigation into Mr. Simpson several months ago after he began posting on social media about the Islamic State, the extremist group also known as ISIS or ISIL, according to law enforcement officials. As part of that inquiry, the authorities monitored his online postings and occasionally put him under surveillance, but they had no indication that he planned to launch the attack in Garland, the officials said.
The F.B.I. had not previously investigated Mr. Soofi, they said. Police officers and federal agents raided an apartment in Phoenix early Monday that neighbors identified as Mr. Simpson’s home; public records show Mr. Soofi living in the same apartment complex, but it was not clear if they lived together.
About the time of the attack Sunday, on a Twitter account with the name “Shariah is Light” that has since been suspended, someone posted using the hashtag #texasattack. The profile picture on the account is of Anwar al-Awlaki, a militant imam killed in a 2011 American drone strike in Yemen.
Mr. Awlaki repeatedly called for violence against cartoonists who, in his view, insulted the Prophet Muhammad. The Twitter post says that the writer and the man with him have “given bay’ah,” or pledged loyalty, “to Amirul Mu’mineen,” a title meaning commander of the faithful that was used by early Muslim rulers and has been claimed by Abu Bakr al-Baghdadi, leader of the Islamic State. “May Allah accept us as mujahedeen.”
The nonprofit Middle East Media Research Institute identified the account as belonging to one of the two gunmen, and said that some of his social media contacts were known supporters of the Islamic State.
Asked whether the Twitter account was Mr. Simpson’s, a senior law enforcement official briefed on the investigation said, “That’s certainly what we believe at this point.” The official, who spoke about the investigation on condition of anonymity, said there was no evidence so far that the attack had been directed or planned by a foreign terrorist group, though sorting out the communications between the attackers and militants using social media and other means would take some time.
In Washington, Homeland Security Secretary Jeh Johnson said in a statement on Monday that law enforcement authorities continued to investigate the suspects’ motives.
“While all the facts are not in yet, last night’s attack serves as a reminder that free and protected speech, no matter how offensive to some, never justifies violence of any sort,” Mr. Johnson said.
In Phoenix, Usama Shami, president of the Islamic Community Center, a mosque three miles south of where Mr. Simpson and Mr. Soofi lived, described Mr. Simpson as well liked among the young men of the mosque.
Mr. Simpson had converted to Islam while in high school and adopted the Muslim name Ibrahim, Mr. Shami said. Mr. Simpson was focused on the basic issues about his faith, grounded in questions young converts ask about fasting and the rules of courtship and marriage, Mr. Shami said.
Mr. Simpson never engaged in radical speech at the mosque, never questioned the pacifist message sermons were built around, Mr. Shami said.
But Mr. Shami said Mr. Simpson seemed changed after his federal case. He would show up only occasionally on Fridays. “There were no flashes of anger or radicalization, just an absence of happiness,” Mr. Shami said.
In a statement, relatives of Mr. Simpson called the shooting an “act of senseless violence.”
“As a family we do not condone violence and proudly support the men and women of our law enforcement agencies,” read the statement, which was released by the Phoenix law firm Osborn Maledon. “We are sure many people in this country are curious to know if we had any idea of Elton’s plans. To that we say, without question, we did not.”
A Facebook page that appears to be Mr. Soofi’s says he graduated from the International School of Islamabad, in Pakistan, in 1998, but a first cousin of his said he was born in the United States. The page also says he attended the University of Utah.
“We’re all devastated,” the cousin, who did not want to be identified, said of Mr. Soofi’s relatives. “We just barely found out just now on CNN.”
Some years ago, Mr. Soofi sold his Phoenix pizza restaurant, which was struggling. Mr. Soofi had moved to Arizona from Texas, and he and Mr. Simpson seemed to have struck a friendship, but to Mr. Shami, it was nothing that seemed out of the ordinary.
On Sunday, the art exhibit and contest unfolded without incident for nearly two hours beginning about 5 p.m. inside the Culwell center, which is run by the Garland Independent School District. About 200 men and women were in attendance.
Weeks ago, Garland police commanders, assisted by city and school district officials, came up with a security plan shortly after the district agreed to rent the facility to the organizers, the American Freedom Defense Initiative, a New York-based group that also uses the name Stop Islamization of America.
The group paid an additional $10,000 for security at the event that included scores of uniformed officers, a bomb squad and a police SWAT team in military fatigues, the authorities said.
About 6:50 p.m., shortly before the contest was scheduled to end, Mr. Simpson and Mr. Soofi, in a dark-colored sedan, approached a police patrol car that had blocked their entrance to the event.
Inside the patrol car at the west entrance to the parking lot were a Garland traffic officer and a school district security officer, and they were exiting their vehicle as the sedan drove toward them, the authorities said.
Mr. Simpson and Mr. Soofi stopped their sedan, stepped from their vehicle and opened fire on the officers, using the back of the car as cover. In a matter of seconds, the Garland traffic officer shot and killed both gunmen with his service pistol, officials said.
Officer Joe Harn, a spokesman for the Garland Police Department, said that both suspects died in the parking lot next to the sedan. The school officer, who was unarmed, was shot in the lower leg, but was later treated and released from a hospital.