Israeli security forces arrested a Gazan man, in Israel on a permit to seek medical help, accusing him of planning to carry out a terror attack upon his return to the Strip.

The Shin Bet security service made the arrest at the beginning of December, but a gag order on the case was only lifted Thursday.

Mahmoud Tsaba Mahmoud Abu Amsha, 32, a member of the Al-Aksa Martyr’s Brigade from Beit Hanoun in the Gaza Strip, was given a permit to travel to Ramallah in the West Bank for medical treatment for his eye.

During questioning by the Shin Bet, Amsha admitted that he planned to carry out a sniping attack on IDF forces patrolling along the border fence with Gaza.

In preparation he carried out surveillance of IDF forces in various areas, practiced shooting, and investigated different scenarios for the attack. Amsha planned to carry out the attack after receiving the medical treatment and returning to Gaza.

An indictment served against Amsha at the Beersheba District Court on Thursday claimed he had planned to carry out a shooting attack during his time in Israel.

He put off the attack after developing “an eye condition which impaired his sniping ability,” according to a statement from the IDF, and planned to carry out the attack upon returning with a repaired eye.

Amsha was also accused of involvement in attacks on Israeli civilians and IDF soldiers in the past.

On Tuesday, an Israeli worker was killed by a Palestinian sniper while working on repairing the border fence. The attack drew retaliatory Israeli strikes on the Strip.

According to the IDF, every month thousands of Gaza residents are granted permits to enter Israel for humanitarian reasons. However, terror groups abuse the permit system to transfer finances for terror; some members also remain in Israel illegally.

“In this case, it was a particularly cynical use of the humanitarian permits in order to succeed in a sniping attack,” the IDF said in a statement.

News of the arrest came as Israel is dealing with an apparent uptick in isolated terror incidents, including an attempted bus bombing in Bat Yam on Sunday and the stabbing of a policeman on Monday.

On Thursday, a car with Palestinian license plates nearly hit an Israeli policeman as it busted through a roadblock set up at the entrance to a Jerusalem area town.

Police had set up the roadblock to stop the car, which was observed speeding toward the Palestinian city of Eizariya on the road from Maaleh Adumim.

One of the policemen attempted to block the car’s passage but the driver continued on his way, nearly running over the officer. Police opened fire on the car but failed to stop it.

Security forces, with the assistance of a helicopter, converged on Eizariya to look for the car.