A “serious terrorist attack in Jerusalem” was prevented by the Shin Bet (Israel Security Agency) in conjunction with Israel Police, it was announced on Friday.

According to the Shin Bet, security forces uncovered an eight-person terror cell of east Jerusalem residents from the neighborhoods of Sur Baher and Sheikh Jarrah, planning to carry out a shooting attack against an IDF base in Jerusalem. The cell, made up of mostly minors and Hamas activists, were arrested in November.

The cell members had been arrested throughout 2015 for taking part in riots and had begun planning shooting attacks in Jerusalem while they were in prison, including attacking an IDF base next to the Hebrew University’s Mount Scopus campus, the Shin Bet said in a statement. When they were released from prison, some of the cell members began to observe the base to find the best way to attack it.

During the investigation, some of the cell members admitted to having taken part in violent demonstrations during the month of Ramadan in the Old City of Jerusalem and the Temple Mount  as well as during memorial rallies for terrorists who had been killed by security forces, the Shin Bet said.

According to the Shin Bet, the cell “demonstrates the grave danger of attackers with Israeli documentation who enjoy freedom of movement and have access to arms and the relative ease of carrying out attacks.”

On Thursday the Shin Bet announced that security forces foiled a Hamas plot to carry out terror attacks and kidnappings in order to negotiate a prisoner swap.

According to the Shin Bet, several operatives from Hamas cells from Tzurif and Hebron in the West Bank were arrested in a joint operation by the IDF, police and Shin Bet in October after it was discovered that they were planning to carry out terror attacks, including shooting and kidnappings of Israelis.

As part of the investigation into the cell, Israeli security forces seized two AK-47s, three pistols, a hunting rifle, a long-barreled M-16, a short-barreled M-16, clips and ammunition.

According to a statement put out by the Shin Bet, “the uncovering of the infrastructure reveals the high motivation of Hamas militants, both in the field and in prison, to carry out severe attacks including shootings and abductions.”