(CNN) -- Egyptian President Mohamed Morsy on Friday visited the border with Gaza, where clashes have erupted in recent days between militants and security forces, and vowed to bring justice to those affected.
"The blood that was lost, right here in this area, for the sake of our country, was at the hands of treacherous criminals," he said. "We will never, ever rest until we take revenge and bring back justice to those killed."
Morsy said he would restore stability and security to the area.
Morsy visited the military post in Rafah and celebrated the Iftar dinner with troops. He was accompanied by Field Marshal Mohamed Hussein Tantawi, Chief of Staff General Sami Annan and newly appointed Minister of Interior Ahmed Gamal Al Din.
Morsy's visit came after a string of violent acts in the area.
A checkpoint at Al Reissa was the scene of an hours-long battle between militants and Egyptian security forces Wednesday. It was one of six places that masked gunmen targeted in a coordinated series of attacks in North Sinai that wounded five security officers and a civilian, said Gen. Ahmed Bakr, head of North Sinai security.
Egyptian army Apache helicopters fired rockets Wednesday, causing numerous casualties, Bakr said. State-run Nile TV reported that the strikes killed at least 20 in the port town of El Arish.
CNN has not been able to confirm the deaths.
Egyptian security forces arrested nine "terrorists" in the Sinai, Nile TV said Friday.
The developments came after 16 Egyptian soldiers were killed and seven others were wounded Sunday in an attack near the Rafah border crossing, when assailants with semiautomatic weapons and hand grenades stole two armored vehicles from Egyptian forces and tried to enter Israel.
Hamas condemned Sunday's attack as an "ugly crime."
On Friday, 1,349 people passed through the Rafah crossing before 5 p.m., said Maj. Sadek Al Assabgi of the 2nd Egyptian Army, which is in charge of the border. Afterward, another 250 pilgrims who had visited Mecca in Saudi Arabia returned to Gaza by way of an extension, he said.
The Rafah crossing was also to be opened Saturday to let Palestinians cross from Egypt to Gaza.
Violence has spiked because jihadists in the region see "an opportunity," said Adam Raisman, a senior analyst with the SITE Intelligence Group, which monitors jihadist groups.
"They see that what they wanted from the Egyptian revolution has not come to fruition," Raisman said. "They wanted a Sharia-based government." Angry with Morsy for not building a fundamentalist government, jihadists are "taking advantage of the tumult in the region," the analyst said.
Morsy resigned from the Islamist Muslim Brotherhood after winning the election, promising to be a president to all.
Jihadist elements in the Sinai region express solidarity with Palestinian groups "and espouse the same beliefs and the same goals," Raisman said.
But there could be a more complicated plan behind the recent attack, according to Elliott Abrams, senior fellow for Middle Eastern studies at the Council on Foreign Relations: to drive a wedge between the new Egyptian government and the military.
The Egyptian military has been cooperating with Israel, particularly on intelligence matters involving jihadists in the Sinai. But the Muslim Brotherhood, the dominant party in the new Egyptian government, sees Israel as the enemy and is not comfortable with that cooperation.
As the violence has spiraled, the military has had more reason to cooperate with Israel, angering the Brotherhood even more.
"This drives a wedge between the army and the Brotherhood," Abrams said.
But the violence presents Morsy with an opportunity, said Patrick Skinner, a senior associate with The Soufan Group, which tracks global security issues.
Since Sunday's attack did not kill Israelis, standing up against the perpetrators "will make him look stronger" to Egyptians, Skinner said. It can be "unifying."
It also "really helps his relationship with the Israelis," Skinner added.
Sinai has long had its own identity, with many inhabitants -- particularly Bedouins -- not considering themselves Egyptians. They complain of a heavy-handed Egyptian state intruding on their terrain, providing large tracts of land to Cairo-based businessmen and investors, and failing to involve them in developing the region's prosperity.
Journalists Mohamed Fadel Fahmy and Ian Lee and CNN's Talal Abu-Rahma, Josh Levs, Ben Wedeman, Samira Said and Joe Sterling contributed to this report.