The Obama administration said Monday any offense taken by a contest to draw Prophet Muhammad cartoons in Texas was no justification for the shooting Sunday in suburban Dallas that injured a security guard and left the two attackers dead.

"There is no act of expression, even if it's offensive, that justifies an act of violence," White House press secretary Josh Earnest told reporters on Air Force One Monday.

"We have seen extremists try to use expressions that they considered to be offensive as a way to justify violence not only in this country but around the world, and in the mind of the president there is no form of expression that would justify an act of violence."

Two gunmen on Sunday opened fire outside the event in the metro-Dallas area, wounding a security guard. Both the gunmen were killed.

Obama was informed of the violence on Sunday, and the White House said he credited police officers for limiting the carnage.

"We saw a pretty important and notable display of bravery on the part of first responders and…because of their courage the only person that was injured by these gunmen was a security officer," Earnest said.

Texas police were able to keep the gunmen from getting inside the venue where the cartoon contest took place.

The White House weighed in on the shooting as Obama traveled to New York Monday to announce the creation of a nonprofit tasked with advancing the administration's work on upward mobility for young men of color.