Two residents of eastern Jerusalem were charged Sunday with planning to carry out a shooting attack at a Tel Aviv beach for the Hamas terror organization.

According to the indictments filed at the Jerusalem District Court, the men, ages 23 and 27, concocted the plot while serving time together for terrorism-related offenses in Israel’s Nafha Prison in the Negev in 2017.

According to the charges, the two chose the Tel Aviv seaside as a target over Jerusalem due to the high number of attacks in Israel’s capital city and the higher police presence there.

The indictment noted that after their release from prison in February 2019, the men traveled to Istanbul, where they met with a Hamas operative who recommended that they assassinate former Jerusalem Mayor Nir Barkat, ex-Israel Police Chief Roni Alsheich, or Temple Mount activist and then-Likud Knesset member Yehudah Glick. They were given funds and pants stitched with hidden messages from Hamas, according to the indictment.

Glick survived an assassination attempt in 2014 by a member of the Palestinian Islamic Jihad.

A third eastern Jerusalem man was also indicted for making contact with the Hamas operative in Istanbul and receiving funds from him.

Prosecutors are requesting that all three men remain incarcerated until the conclusion of their trials.

In January, another eastern Jerusalem Arab was sentenced to 11 years in prison for planning to assassinate Israeli Prime Minister Benjamin Netanyahu and Barkat on the orders of the Syrian-based Popular Front for the Liberation of Palestine.