A major effort by Gaza-based Palestinian terrorists to infiltrate into Israel was thwarted on the Israel-Egypt-Gaza border on Sunday night.

The gunmen killed at least 16 Egyptian soldiers and commandeered two Egyptian armored vehicles before attempting to cross into Israel; they were stopped by the army and the air force, and several terrorists were killed. The death toll was earlier reported as 15.

The army and the police continued searching the area overnight, and additional troops were deployed, in case any of the terrorists were still on the loose inside Israel.

No Israelis were reported injured in the attack. Israeli residents in the area were told to stay inside their homes late into the night.

The Israeli security forces had advance intelligence on plans for an attack, the IDF Spokesman Yoav Mordechai said. Maj.-Gen. Tal Russo, the O/C Southern command, was at the scene.

Prime Minister Benjamin Netanyahu praised the security forces for thwarting the attack, and said in a statement that Israel would track down “anyone who tries to harm us.”

Defense Minister Ehud Barak said the IDF and Shin Bet security service had thwarted what could have been a grave attack, and praised their alertness and determined action.

Barak urged Egypt to take steps to restore security to the Sinai.

A spokesman for Hamas leader Ismail Haniyeh condemned the attack on Egyptian soldiers and said officials had sealed off all smuggling tunnels on the Strip’s border with Sinai to prevent the perpetrators from leaving Egypt, according to Israel Radio.

The official, Yussuf Rizka, claimed there was no evidence that the attackers came from Gaza. He added that Hamas would cooperate with the Egyptian military regarding the incident.

Egyptian and Israeli media said Gaza-based Palestinians were involved in the attack. An Egyptian border official said the Rafah terminal between Egypt and Gaza had been closed indefinitely.

Egyptian President Mohammed Morsi’s office issued a statement offering his condolences to the families of the dead and saying the “cowardly” attack will not go “without a response.”

“Those who carried out this crime will pay dearly,” Morsi’s statement said.

Morsi met with military chiefs in the wake of the incident. In an interview on Egyptian state TV early Monday after the meeting, the president said orders had been issued to arrest the perpetrators.

“There is no room for appeasing this treason, this aggression and criminality,” Morsi said. “The troops will totally control Sinai.”

In a statement issued late Sunday, Morsi’s Muslim Brotherhood urged Egyptian authorities to take all necessary measures to “confront this serious challenge to Egyptian sovereignty and to protect Sinai from all armed groups.”

At least 15 Egyptian soldiers — some reports spoke of 20 — were killed and seven injured by the terrorists at the start of the attempted infiltration, which began with an armed assault on an Egyptian military position on the border. The gunmen launched the attack around 8 p.m. while the Egyptian troops were breaking their Ramadan fast.

After gunning down the Egyptian soldiers, the terrorists commandeered the two Egyptian vehicles, and tried to smash through the border into Israel at the Kerem Shalom crossing, reportedly firing as they moved.

The first vehicle was said to have exploded on the Egyptian side of the border crossing. The second vehicle moved towards Israel and the IAF blew it up. Conflicting initial reports spoke of three to six terrorists who were killed by Israeli army troops, the Army Spokesman said.

Armed terrorists were reported to have exited one of the armored vehicles. IDF forces were conducting searches in the area late into the night for any remaining terrorists.

The Army Spokesman said no soldiers had been kidnapped in the incident.

Security establishment officials said that there was no connection between Sunday evening’s incident and the IAF airstrike in Rafah earlier in the day in which a terrorist was killed.

The attack came shortly after a mortar barrage from the Gaza Strip pounded the Kerem Shalom border crossing in Israel and rockets were fired at adjacent towns.

In recent days, Israel and the US issued warnings about the Sinai area. On Friday, the US urged its citizens to “take precautions in travel to the Sinai.” It warned that “overland travel from Israel to the Sinai in particular is strongly discouraged.”

On Thursday, Israel’s Counterterrorism Bureau warned its citizens to leave Sinai immediately. “We possess information that Gaza terror groups and others are planning attacks on Israeli tourists in the immediate future,” the government agency said in a statement.

The warnings came amid reports that Hamas on Thursday freed a Salafi leader of an al-Qaeda affiliated terror group. His group is believed to have close ties with terror cells currently operating in the Sinai.

Israel reportedly believes the terrorist, Abu Walid Al-Maqdisi, who was set free after some 17 months on Thursday, was the mastermind of three bombings in Dahab in Egypt’s Sinai Peninsula that killed more than 20 people in 2006 and fears his release could lead to more such attacks.

Al-Maqdisi, an Egyptian previously residing in Gaza whose real name is Hisham al-Saidni, is the head of Jama’at al-Tawhid wal-Jihad, an Islamic extremist group that also is believed to have kidnapped, and killed, Italian peace activist Vittorio Arrigoni in Gaza in April 2011. Gaza’s Hamas rulers had arrested al-Maqdisi at around the same time for attempting to disrupt public order.