Islamic State militants have launched a wave of attacks on the security forces in Egypt’s restive Sinai Peninsula.
The military said 10 soldiers had been killed or wounded along with 39 “terrorists” in near-simultaneous raids on checkpoints near Sheikh Zuweid.
But security and medical sources said as many as 50 soldiers had died.
Clashes are continuing in the area, with militants reportedly roaming the streets of Sheikh Zuweid and besieging the town’s main police station.
Islamic State’s local affiliate, Sinai Province, said in a statement posted online that it had targeted 15 security sites and carried out three suicide attacks.
The assault is one of the biggest since jihadists based in Sinai stepped up their attacks after the military overthrew Islamist President Mohammed Morsi two years ago. At least 600 police and armed forces personnel have since been killed.
Wednesday’s attacks came two days after the assassination of Egypt’s public prosecutor, Hisham Barakat, in the capital Cairo.
In a speech at Mr Barakat’s funeral on Tuesday, President Abdul Fattah al-Sisi promised legal reforms to ensure death sentences could be enforced more swiftly for those convicted of acts of terrorism.
Analysis: Sally Nabil, BBC News, Cairo
The attack in Sheikh Zuweid is one of the biggest of its kind targeting the army in Sinai.
Eyewitnesses say IS-affiliated militants are roaming the streets, raising the flags of the extremist group. But it is always hard to verify any story in Sinai.
The army has enforced a total media blackout on the area since it intensified its fight against jihadists in 2013.
These latest assaults prove that the battle is still far from over. The long military operation, which was meant to restore peace to Sinai has, so far, failed to uproot extremism.
President Sisi has vowed to accelerate his crackdown against the “terrorists”, a broad term which does not only include extremist fighters in Sinai, but possibly all Islamists.
But many are questioning how effective his military solution is.
On Wednesday morning, more than 70 militants fired mortar rounds and detonated a car bomb in attacks on five checkpoints in the Sheikh Zuweid area of North Sinai province, military spokesman Brig-Gen Mohammed Samir said.
Ten soldiers were killed or wounded and 22 “terrorists” were killed, he added. Later, the general noted that the number of casualties on both sides had increased.
Security and army officials told the Associated Press that at least 50 troops had been killed and 55 wounded, and that several had also been taken captive.
Sources meanwhile told the Reuters news agency that at least 36 soldiers, policemen and civilians had been killed along with 38 militants.
Dr Osama el-Sayed of El-Arish General Hospital was cited by Reuters as saying 30 bodies had been brought in, “some of whom were wearing army fatigues”.
Gen Samir said clashes were continuing in area between troops and the militants.
Officials told AP that dozens of policemen were inside Sheikh Zuweid’s main police station, which they said was coming under mortar- and RPG-fire.
The militants were reported to have planted bombs around the station to prevent the policemen leaving, and also along a road between Sheikh Zuweid and a nearby army camp to prevent reinforcements arriving.
North Sinai has been under a state of emergency and a curfew since October, when an attack on a checkpoint in El-Arish left dozens of soldiers dead.
Police and army patrols have been increased and additional checkpoints have been set up. In addition, a buffer zone along the border with Gaza has been created by demolishing houses and destroying underground tunnels the military says have been used to smuggle weapons from the Palestinian enclave.
Analysts said the car bomb attack in Cairo that killed Mr Barakat bore the hallmarks of Sinai Province. The group was known as Ansar Beit al-Maqdis until it pledged allegiance to Islamic State in November and changed its name.
Hours after President Sisi’s speech on Tuesday, a soldier was shot dead outside a museum in southern Cairo and three suspected militants were killed when a car in which they were travelling blew up near a police station in a western suburb.