GettyImages-504051644
Police tape is placed in front of the Yeadon, Pennsylvania, home of police officer shooting suspect Edward Archer, 30, who allegedly shot 13 times at Philadelphia Police Officer Jesse Hartnett, Jan. 8, 2016. Getty Images

The suspected gunman who shot a barrage of bullets into a Philadelphia police car late Thursday and who also allegedly pledged allegiance to the Islamic State group reportedly traveled to the Middle East twice in the past five years, ABC News reported. Edward Archer, now in police custody, traveled once to Saudi Arabia in 2011 for hajj — the Muslim pilgrimage — and once to Egypt the following year, law enforcement officials said.

On both trips Archer flew out of New York-area airports using a U.S. passport. The FBI is investigating if the trips had anything to do with the shooting.

Archer, from Yeadon, Pennsylvania, about 25 minutes from Philadelphia, allegedly shot at Police Officer Jesse Hartnett more than 10 times, hitting him three times, leaving him in a critical but stable condition.

Archer told detectives he follows “Allah. I pledge my allegiance to the Islamic State, and that's why I did what I did,” Philly.com reported.

Police are looking into whether Archer had any contact with the extremist organization, also known as ISIS, or other terrorist cells. The FBI searched his house after the shooting and also was combing through his internet activity to see if he was connected to the group.

While Archer may have pledged his allegiance to Islam, city officials were quick to say the attack was not related to the teachings of the religion and that Archer is just a criminal. “In no way, shape or form does anyone in this room believe that Islam or the teaching of Islam has anything to do with what you’ve seen on the screen,” Philadelphia Mayor Jim Kenney said in reference to the video of the shooting, according to CBS News.

“This is a criminal with a stolen gun who tried to kill one of our officers. It has nothing to do with being a Muslim or following the Islamic faith,” he said.

Philadelphia’s Muslim leaders also condemned the shooting. Ahmadiyya Muslim Community USA spokesperson Bilal Quayyum said many Muslims in Philadelphia are upset someone would commit a violent act in the name of Islam.