An Arab-Israeli lawmaker who smuggled cellphones to Palestinian terrorists in Israeli prisons will resign and serve two years in jail as part of a plea bargain.

The deal involving Basel Ghattas of the Balad party, which is part of the Arab Joint List, was worked out and agreed upon Thursday, the Maariv news site reported. Ghattas was suspended in January by the Knesset Ethics Committee.

Ghattas was captured on a video surveillance camera in January passing the phones to two Palestinian security prisoners in Ketziot Prison. At first he denied passing the phones, but reportedly admitted it after being shown the video. Ghattas said he thought the packages contained reading material.

He said his action was “humanitarian and moral activism” after he was questioned two weeks ago.

Ghattas was charged with smuggling contraband into prison; affording means to commit a terrorist act; illicitly introducing documents into prison, and deceit and breach of trust by a state employee, the Israeli media reported.