GAZA CITY—On a recent surveillance patrol, Israeli soldiers watched as a squad of Hamas militants approached the tense border between Gaza and Israel. But the commandos weren’t there to attack, but rather to block rogue militants seeking to launch rockets into Israel, an Israeli commander said.

Such patrols, confirmed by Hamas, are aimed at stanching a series of attacks by extremists aimed both within and outside the enclave that the Islamist group runs. Still, some attacks are occurring in any case, and Israeli and Palestinian officials fear that if unchecked, they may threaten a fragile cease-fire with Israel that has held since a bloody 50-day conflict ended in August.

“They are trying to embarrass Hamas,” said Mkhaimar Abusada, a political scientist in Gaza City, referring to the extremists. “The aim is to destabilize the cease-fire. Hamas is trying to maintain the cease-fire.”

The sense of disorder began in December when a group of ultraconservative Muslims known as Salafists claimed responsibility for a bomb attack on Gaza’s French Cultural Center that shattered windows and sent a fireball into the night sky, the second assault there in two months. The group, calling itself Soldiers of the Supporters of Allah, released a video that denounced the French as “crusaders.”

Hamas says it is investigating the attacks. French officials declined to comment.