The attackers then drove off, crashing in Israel, officials said on Sunday.
Egypt blamed militants from Gaza and Egypt's troubled Sinai Peninsula. President Mohammed Morsi said the attackers "will pay dearly".
Israel's military said the attack was part of a plot to abduct an Israeli soldier, and two vehicles commandeered by the attackers crashed into Israel, where one blew up.
In a statement, Israel's Defence Minister Ehud Barak said Israel's military and the internal security agency "thwarted an attack that could have injured many. The militants' attack methods again raise the need for determined Egyptian action to enforce security and prevent terror in the Sinai."
The attack took place around sunset in the Egyptian border town of Rafah, when the troops were having the traditional meal at the end of the daily fast during the Islamic holy month of Ramadan.
Egyptian state TV said the attack on the checkpoint was carried out by Islamist militants. The report said 16 troops were killed in the attack coordinated between Palestinians who entered Egypt from Gaza and Egyptians in Sinai.
Emergency services official Ahmed el-Ansari told Egypt's news agency that seven were wounded by gunfire.
Egypt's President Mohammed Morsi convened an emergency meeting with military and security leaders following the attack. In a statement, Morsi declared, "Those who carried out this crime will pay dearly."
In an interview in Egyptian state TV early Monday after the meeting, Morsi said orders have been issued to arrest the perpetrators. "There is no room for appeasing this treason, this aggression and criminality," he said. "The troops will totally control Sinai."
The head of the border guards, a paramilitary force under the command of Egypt's defence ministry, went to the scene of the attack, the TV said.
In a statement late Sunday, Morsi's Muslim Brotherhood urged Egyptian authorities to take all necessary measures to "confront this serious challenge to the Egyptian sovereignty and to protect Sinai from all armed groups".
It was one of the bloodiest attacks in Sinai in years and the deadliest against Egyptian troops, underlining the growing lawlessness of the Egyptian territory, where security forces have become targets of militants, some loosely linked with al-Qaida.
Israeli military spokesperson Lieutenant Colonel Avital Leibovich said one vehicle exploded, and Israeli aircraft struck the second one. Israeli government spokesperson Ofir Gendelman said on his Twitter account that seven militants were killed, four on the Israeli side and three in Egypt.
Leibovich said Israel's soldiers were combing the area for other militants who might still be on the Israeli side of the border. The military instructed Israel's civilians to stay inside their homes.
An Egyptian military official said Egyptian troops were pursuing the militants who returned to Egypt. He said the attackers used three vehicles.
An Egyptian border official said the Rafah terminal between Egypt and Gaza has been closed indefinitely. It is the only crossing from Gaza that is not under direct Israel's control.
A former Egyptian intelligence officer close to the military, Sameh Seif el-Yazel, told state TV the attack began at another checkpoint inside Rafah, where the militants took the armoured vehicles and headed toward the border checkpoint. He said the militants drove about 25m into Israel before Israeli troops attacked them. Some fled back into Egypt, he said.
Egyptian and Israeli officials have been warning of a deteriorating security situation in Sinai, where militants have taken advantage of a security vacuum in the area following the uprising that toppled longtime president Hosni Mubarak last year.
The security official said the attack set off clashes with the gunmen. He later said one of the armored vehicles was found abandoned near the border with Israel.
All the Egyptian officials spoke on condition of anonymity because they were not authorised to speak to reporters.
In a statement posted on the website of Gaza's Hamas leaders, Hamas condemned "the ugly crime committed today against the Egyptian soldiers, and sent its condolences to the families of the victims, to Egypt's president and to his government". Hamas did not fix blame for the attack.
The attack caused confusion among the security agencies because of its surprise nature. It took place at a checkpoint near the border where Israel, Gaza and Egypt meet.
Late last week Israel issued one of its frequent warnings to Israelis to leave the Sinai.
Since Mubarak stepped down, Israel has allowed Egypt to send in more troops to Sinai, which has been mostly demilitarised according to the 1979 peace deal between the two countries. The Sunday attack spurred renewed calls in Egypt to amend the treaty to allow for more troops in Sinai.
A similar attack took place last year, when Palestinian militants crossed from Gaza into Egypt's Sinai Peninsula, made their way along the Israel-Egypt border, crossed back into Israel, attacked Israeli vehicles and killed eight people on August 18 last year. Israeli forces killed six Egyptians soldiers as they chased the militants, increasing tension between the two countries.
Relations between the two nations have always been cool. Since Mubarak was overthrown and Islamist parties moved to the front of the Egyptian political scene, Israeli officials have expressed concern about the possibility of deterioration in relations, while insisting that maintaining the peace treaty is in the interest of both countries. – Sapa-AP