Two gunmen who opened fire at an exhibition and cartoon contest in Texas featuring depictions of the Prophet Mohammed have themselves been shot dead at the scene.

Sorry, this video has expired Gunmen shot dead at controversial Texas art exhibition ( Lisa Millar )

The two armed suspects drove up to the front of the building in a car as the Mohammed Art Exhibit in Garland 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 were shot dead, the city said.

"The first suspect was shot immediately," Garland mayor Douglas Athas told CNN.

"The second suspect was shot and wounded [and] reached for his back pack.

"Of course officers not knowing what was in the backpack, shot him again. He was killed."

A police officer directs the evacuation of attendees of the Mohammed Art Exhibit and Contest. ( Reuters: Mike Stone )

The security officer was wounded in the gunfire, but the guard's injuries were not considered life-threatening, according to the city's statement.

A police officer was also shot in the leg and was taken to hospital, but has since been released.

Loading

The contest and exhibition, near Dallas, was billed as a "free speech" event, and featured far-right populist Dutch politician Geert Wilders.

The event's organisers, the American Freedom Defence Initiative (AFDI), had offered a $US10,000 prize for the winner of the cartoon contest.

City police spokesman officer Hoe Harn said officers were examining the suspects' car for any explosives that might be in the vehicle, a process which may take hours.

There was no immediate word from police or other authorities about the identity or background of the two suspects.

"I have no idea who they are, other than they're dead and in the street," Mr Harn said.

Mr Wilders, who had addressed the gathering, said he was "shocked" by the shooting outside the contest.

"I just spoke for half an hour about the cartoons, Islam and freedom of speech and I had just left the premises," he said.

Security on hand for controversial event

A police officer stands near a school bus used to evacuate attendees of the Mohammed Art Exhibit. ( Reuters: Mike Stone )

Western art depicting the Prophet has at times angered Muslims and provoked threats from radicals.

In January, Islamist gunmen attacked the Paris offices of the French satirical magazine Charlie Hebdo in revenge for its cartoons of the Prophet, killing 12 people.

The AFDI, also known as Stop Islamisation of America, previously spearheaded campaigns against the building of Islamic centres, as well as running anti-Islam advertisements across the US.

The organisation said it was charged roughly $US10,000 for security when it booked a Gardland Independent School District (GISI) building for the event.

The mayor said the city permitted the event though officials knew its inflammatory theme could provoke an attack.

Police officers block an intersection near the scene of the shooting. ( Reuters: Mike Stone )

"There was concern, which is why we had heightened security in the area, but we all swear to uphold the constitution: free speech, free assembly and in this case perhaps, free religion," Mr Athas said.

"So in this case they were free to use the building."

In a blog post in the lead-up to the event, Ms Geller said in a blog post: "How is free speech an attack on Islam? And why are they portrayed as the victim when we are the victims of supremacism [sic] and jihad?"

In a blog post after the attack, Ms Geller said the shooting was part of "a war on free speech".

ABC/wires