TEL AVIV — The head of the Shin Bet security agency on Wednesday warned against allowing Hamas to turn into a second Hezbollah ahead of a ceasefire deal with the Gaza-based terror group.

According to a report by the Hebrew-language Yedioth Ahronoth, Nadav Argaman told Prime Minister Benjamin Netanyahu, Defense Minister Naftali Bennett, IDF Chief of Staff Lt.-Gen. Aviv Kochavi, and other members of the security council that if left unchecked, Hamas would intensify its efforts in building up its weapons stockpile as Hezbollah did after the 2006 Second Lebanon War.

Argaman also warned against a ceasefire agreement that was putting Gaza’s humanitarian needs ahead of Israel’s security needs. The agreement, which will be mediated by Egyptian officials and signed before the elections in March, will allow for an increased number of Palestinian laborers from Gaza to gain entry permits into Israel — a concession Argaman warned could end up being used to carry out terror attacks in Israel.

According to the report, most of the terms of the deal have already been agreed upon.

As part of the agreement, Israel will expand Gaza’s fishing zone and allow for several humanitarian and infrastructure projects, including the construction of a natural gas pipeline and increased medical assistance and equipment for hospitals.

Hamas will agree to end the launch of missiles into Israel as well as the cessation of gunfire along the Gaza border fence. The terror group also agreed to gradually reduce the violent weekly border protests.

The ceasefire deal does not demand the return of the remains of Lt. Hadar Goldin and St.-Sgt. Oron Shaul, two soldiers who died in the 2014 Operation Protective Edge and whose bodies have been kept by Hamas ever since. Neither does the agreement mention the return of two Israeli citizens, Avera Mengistu and Hisham al-Sayed.

Argaman also warned against weakening the Palestinian Authority (PA), whose security forces cooperate with the Shin Bet in fighting terror in the West Bank. Some 149 million shekels ($43 million) was withheld by Israel from PA tax revenues it collects on its behalf over the PA’s so-called pay-for-slay program paying terrorists and their families a stipend, provoking outrage in Ramallah.

According to Argaman, it was unwise to enact punitive measures against the PA while at the same time rewarding Hamas with concessions.