By Paul Ingram

PHOENIX (Reuters) - Arizona police stepped up security near a mosque on Friday ahead of a planned anti-Islam demonstration featuring displays of cartoons of the Prophet Mohammad, weeks after a similar contest in Texas came under attack from two gunmen.

Friday's event outside the Islamic Community Center of Phoenix was being organized by an Iraq war veteran who posted photos of himself online wearing a T-shirt with the slogan "Fuck Islam" on it and waving the U.S. flag.

More than 900 people wrote on the event's Facebook page that they would take part in the Phoenix demonstration at 6:15 p.m. local time (0115 GMT on Saturday).

The Facebook invitation urged a peaceful demonstration but encouraged those who attend to exercise their Second Amendment right to carry a gun to be prepared should they come under attack.

Caricatures of the Prophet Mohammad have been a flashpoint for violence in Europe and the United States in recent months

with many Muslims believing such pictures are blasphemous.

An Arizona Muslim leader urged worshippers to avoid what he said was a protest by "members of an armed biker gang" seeking to harass them.

Officials at the mosque could not be reached for comment, but its website highlights a series of sermons at Friday prayers there last year by an imam condemning extremist Islamist groups like Islamic State, al Qaeda and Nigeria's Boko Haram.

The Phoenix police department planned to have a presence throughout the neighborhood where the mosque is situated, bringing in staff from other details as needed, said spokesman Sergeant Trent Crump.

"Dealing with groups of protesters and opposing views is not the difficult part. Our goal and the real challenge are trying to anticipate unlawful activities that might occur in conjunction with these events," Crump said.

ACT OF RETRIBUTION

In January, gunmen killed 12 people at the Paris office of the satirical magazine Charlie Hebdo in anger at the magazine's cartoons featuring the Prophet.

Story continues

A similar attack was foiled outside Dallas on May 3 when the two gunmen opened fire outside an exhibit of cartoons of Mohammad. The pair, who local media say had attended the Phoenix mosque targeted in Friday's event, were shot dead by police without killing anyone.

The Department of Homeland Security has been in touch with state and local law enforcement authorities, and is monitoring the situation in Phoenix, White House spokesman Josh Earnest said.

"Even expressions that are offensive, that are distasteful, and intended to sow divisions in an otherwise tight-knit, diverse community like Phoenix, cannot be used as a justification to carry out an act of violence, and certainly can't be used as a justification to carry out an act of terrorism," he told reporters.

Organizers of the Phoenix event described it as an act of retribution for the attack in the Dallas suburb of Garland.

"This is in response to the recent attack in Texas where 2 armed terrorists, with ties to ISIS, attempted jihad," organizers said in a Facebook posting, using a shorthand name for the Islamic State.

U.S. officials investigated claims that the Texas gunmen had ties to the Islamic State militant group, based in Syria and Iraq, but never established a firm connection.

'EPIDEMIC OF ANTI-ISLAMIC SENTIMENT'

The main organizer, Phoenix resident Jon Ritzheimer, said the point of the contest to draw Mohammad was "to expose the true colors of Islam."

"True Islam is terrorism. Yes, the ones that are out committing these atrocities and stuff, they are following the book as it’s written,” Ritzheimer told CNN.

Ritzheimer was a staff sergeant in the Marine Reserve and was deployed to Iraq twice, in 2005 and 2008, the Marine Corps told Reuters.

The mosque is a former church near the city's international airport that can hold some 600 worshippers. The Phoenix area is home to tens of thousands of Muslims.

Local Muslim leaders advised worshippers to stay away from the demonstration, being staged after weekly Friday prayers when mosques are busier than usual.

The event is part of "an epidemic of anti-Islamic sentiment" that goes beyond protesting against extremism, said Imraan Siddiqi of the Arizona chapter of the Council on American-Islamic Relations.

"Don’t mistake that, they’re not saying the want to rid America of radical Islam, they are saying they want to rid America of Islam," Siddiqi said.

(Writing by Alistair Bell; Additional reporting by Scott Malone, Sharon Bernstein, Alex Dobuzinskis, Dan Whitcomb and Cynthia Johnson; Editing by Howard Goller)