One of the two gunman shot dead at a "Muhammad Cartoon Contest" in Texas signalled the planned attack and declared his loyalty to the Islamic State on Twitter.

"May Allah accept us as the mujahideen," said a Tweet officials believe was posted by Elton Simpson, 30, identified as one of the shooters by US authorities. He also tweeted that he and his partner, identified as Nadir Soofi, 34, pledged loyalty to "Amirul Mu'mineen" (the leader of the faithful), which officials believe referred to ISIS leader Abu Bakr al Baghdadi, reports CNN.

The Twitter account, titled Shariah is Light, bore the image of extremist Islamic propagandist Anwar Awlaki, who was killed in an American drone strike in Yemen in 2011. It urged readers to follow another account, AbuHussainAlBritani, which officials believe is operated by Junaid Hussain, a British Isis fighter in Syria, also known as Abu Hussein al Britani.

"The knives have been sharpened, soon we will come to your streets with death and slaughter!" tweeted the second account just before the attack. Later, the poster crowed: "Allahu Akbar! Two of our brothers just opened fire at the ... art exhibition in Texas!" Kill those that insult the Prophet. They Thought they were safe In Texas from the soldiers of the Islamic State."

Both accounts have been suspended.

Simpson and Soofi were shot dead by a police officer guarding the event — organised by conservatives critical of Islam — at Garland's Curtis Culwell Centre near Dallas. They were wearing body armour and brandishing assault rifles. An unarmed security guard was shot in the ankle, but no one else among the 200 or so participants was harmed. The area was evacuated and the event was immediately shut down.

"We don't know their intent, other than that they were willing to pull up and shoot police," Garland Police Department spokesman Joe Harn told reporters. "We think their strategy was to get into the event center, and they were not able to get past our perimeter," added Harn who credited the police officer with saving lives.

The event featured a contest to "Draw Muhammad," which many Muslims consider blasphemous, and also hosted a speech by right-wing Danish politician Geert Wilders, who's on al-Qaeda's hit list. Authorities believe the men were acting alone and more arrests appear to be unlikely.

There were no explosives or addition weapons in the dead gunmen's car, parked near the convention centre. Authorities also launched a search of the apartment in Phoenix, Arizona, that the two shared, but the result of that was not immediately know.

Simpson was known to the FBI. He was sentenced to three years probation in 2011 for making a false statement involving international and domestic terrorism and sentenced to three years of probation, according to court records. He lied when he told FBI agents that he had not discussed traveling to Somalia to engage in "violent jihad," according to the indictment against him.

The provocative event was organised by New Yorker Pamela Geller, the president of The American Freedom Defence Initiative, known for her vitriolic subway ads. "In any war between the civilized man and the savage, support the civilized man. Support Israel. Defeat Jihad," the ads state. After the shooting Geller posted on her blog: "This is a war. This is war on free speech. Are we going to surrender to these monsters?"

The event was intended as a defiant gesture after the terrorist attack early this year on the Paris offices of the satirical magazine Charlie Hebdo for printing images of the prophet Muhammad. Two gunmen killed 12 members of the staff and wounded 11 others.

British far-right provocateur Tommy Robinson of the English Defence League has vowed to organise a similar Draw Muhammad event in Britain in solidarity with the people of Texas.