A Palestinian man convicted last year of planting a bomb on a bus in Tel Aviv during Israel’s Operation Pillar of Defense was sentenced to 25 years in prison on Monday.

Muhammad Mafarji, 18 years old at the time of the attack in 2012, was found guilty last December of attempted murder and aiding the enemy during wartime. Twenty-eight people were injured when the bus exploded near Israeli military headquarters in the center of Tel Aviv.

His lawyer had reached a plea bargain with the prosecution, under which the state would not seek a sentence of more than 25 years in prison for the act.

Mafarji confessed to the Shin Bet security service that he placed an explosive device on bus No. 142 on November 21, 2012. The bomb detonated near the Israeli military’s headquarters in the center of Tel Aviv, injuring 28 people.

He said he did this in order to assist Hamas in the Gaza Strip and avenge the death of Hamas military commander Ahmed Jabari, who was killed in a drone strike that marked the onset of the Israeli campaign to curb rocket fire from Gaza.

The bombing took place at the tail end of the military operation.

Lazar Berman contributed to this report.