Correction, 5/5/2015:: An earlier version of this story wrongly referred to NBC's Jay Gray as an Al Jazeera correspondent.

US authorities are reportedly investigating links between two gunmen shot dead after opening fire outside a Texas art exhibition featuring cartoons of the Prophet Muhammad, and groups such as the Islamic State of Iraq and the Levant (ISIL).

A source told the Reuters news agency that the Federal Bureau of Investigation and other US agencies believed that Sunday's incident could have been instigated or directed by foreign-based groups, such as ISIL.

Jay Gray from the US news network NBC said there was "a lot of speculation" but police were conducting a "long, intensive and meticulous investigation" as they continued to sift through evidence at the scene of the incident outside a cultural centre in the Dallas suburb of Garland.

FBI agents and police on Monday also combed the Phoenix apartment of the two men - named by authorities as roommates Elton Simpson and Nadir Soofi - cordoning off the complex and evacuating residents for several hours into the early morning.

Federal agents have told news agencies that they had monitored Simpson, who had plans to travel to South Africa and join Islamist fighters in Somalia, since 2006.

Court documents obtained by the Reuters news agency said Simpson, who was a convert to Islam, had been under surveillance since 2006 and convicted of lying to FBI agents in 2011 over his intention to go to Somalia. 

Less was known about the other man, his Phoenix roommate Nadir Soofi, who NBC's Gray said was reportedly on a terror watch list.

Body armour

The shooting was reported shortly before 7pm local time on Sunday outside the Curtis Culwell Center in the Dallas suburb of Garland.

The two armed suspects drove up to the front of the building in a car as the event, called the Muhammad Art Exhibit, was coming to an end, and began shooting at a security officer, the city said in a message posted online.

Garland police officers then exchanged fire with the gunmen and both suspects, who were wearing body armour, were shot dead.

The security guard was shot in the ankle in the gunfire, but his injuries were not considered serious and he was discharged from hospital within hours of the incident.

A police bomb squad has been at the scene, but no explosive devices were found. Police were still inspecting evidence around dead gunmen's car.

A Garland police spokesman, Joe Harn, said there was a large police presence already at the scene, as police "had prepared for this event, in case something like this happened".

Controversial advertisement

A New York-based group called the American Freedom Defense Initiative (AFDI) had claimed it was exercising their right of free expression in running the contest.

The judging was supposed to be on Sunday, with the winner from some reported 350 entries from around the country offered a $10,000 prize.

Al Jazeera's Heidi Zhou-Castro said the woman who led the AFDI group, Pamela Geller, was "known to make anti-Muslim statements", and had gone to the courts several times to be able to place anti-Muslim advertisements around New York.

Following the shooting, Geller had tweeted from inside the cultural centre that the incident was "a war on free speech", however her critics on Twitter said she had "been trying to provoke an incident like this for years".

Islam forbids depictions of its prophet.

In April, AFDI won a case in the US federal court that allowed it to display a controversial advertisement referring to Muslims killing Jews on New York's Metropolitan Transportation Authority buses.

US District Judge John Koeltl in Manhattan said the AFDI ad, which had previously run in Chicago and San Francisco, was protected speech under the First Amendment of the US constitution.

Similar AFDI campaigns have also run elsewhere, including in Washington DC.

The ad portrayed a menacing man wearing a scarf around his head and face, included a quotation "Killing Jews is Worship that draws us close to Allah" was attributed to "Hamas MTV", and then stated: "That's His Jihad. What's yours?"

Geert Wilders, the Dutch far-right politician who is well-known for his anti-Islam beliefs, was one of the main speakers during the event. Wilders shared on his Twitter account that he had just left the building before the shooting.

Wilders caused a scandal last March when speaking in The Hague he asked party supporters whether they wanted "fewer or more Moroccans in the city and in the Netherlands".

"Fewer! Fewer!" the crowd shouted as a smiling Wilders answered: "Then we're going to take care of that."

Source: Al Jazeera and agencies