JERUSALEM (Reuters) - Israel said on Thursday it had thwarted a plan by two Israeli Arabs with Islamic State sympathies to mount an attack at a contested Jerusalem holy site where a July gun ambush set off a wave of violence.

The Shin Bet security service described the suspects, aged 26 and 16, as residents of the same Israeli Arab town as three gunmen who on July 14 killed two police guards at a gate to Al-Aqsa mosque compound and were then shot dead.

Israel responded to that attack by briefly installing metal detectors outside the compound, angering Palestinians who saw that as a breach of decades-old access arrangements.

Four Palestinians were killed during ensuing confrontations with Israeli security forces and a Palestinian stabbed three Israeli settlers to death.

The two suspects taken into custody this month “support the Islamic State terrorist group’s murderous ideology and the terrorist attack was meant to be carried out in expression of this”, the Shin Bet said in its statement on Thursday.

It said they had two pistols. “They planned a gun attack at the Temple Mount in Jerusalem similar to what transpired on July 14,” it said without elaborating.

Jews revere the site, where Al-Aqsa mosque and the golden Dome of the Rock now stand, as the location of their two ancient temples. Attempts by Jews to pray there, in violation of access arrangements, have been a source of tension with Muslims.

Israel captured East Jerusalem, including the Old City and the holy compound, in the 1967 Middle East war. It annexed the area in a move that has never been recognized internationally.