Egyptian media reports say at least 235 people have been killed in a bomb and gun attack on a mosque in the country's northern Sinai Peninsula.

The attack occurred in Bir al-Abed, a town in North Sinai province, shortly after Friday prayers.

Egyptian state media MENA put the death toll at 235, citing an official security source. It also said that 120 people were wounded in the attack.

The mosque in Bir al-Abed, about 40km west of El Arish, the provincial capital of North Sinai, was frequented by Sufis.

The government declared a three-day period of mourning for the victims.

Egyptian President Abdel Fattah el-Sisi condemned the attack, which he described as "criminal" and "cowardly" in a televised statement on Friday.

He expressed condolences to the victims and their families and said the attack "will not go unpunished".

"The armed forces and the police will avenge our martyrs and restore security and stability with the utmost force," Sisi said.

{articleGUID}

The Egyptian military launched air strikes on targets in mountainous areas around Bir al-Abed hours after the attack, security sources and witnesses told Reuters news agency.

No group has claimed responsibility but local affiliates of the Islamic State of Iraq and the Levant (ISIL) group have claimed previous attacks.

Officials said the attackers arrived in four 4WD vehicles and carried out their attack while the sermon was being delivered after Friday prayers.

Local media reports said the attackers planted explosives and then opened fire on worshippers.

The attackers next targeted fleeing worshipers with gunfire.

Images on Egyptian state TV showed dozens of bodies covered in blood, lying inside a mosque.

Most of their faces were covered with white cloths, while other bodies were wrapped in prayer rugs. Some men and women could be seen next to the bodies.

The previous attacks in Sinai mostly targeted security forces and members of Egypt's Coptic Christians minority.

However, mosques in North Sinai's Sheikh Zuweid town have also been attacked.

It is believed the Bir al-Abed mosque was an easy target because it was outside the province's main cities.

The mosque may also have been targeted because it followed a Sufi sect. Sufis are considered infidels by groups such as ISIL.

In 2016, ISIL fighters released pictures purporting to be of the execution of a 100-year-old Sufi religous leader, whom they accused of "witchcraft".

Timothy Kaldas, a professor at Nile University in Cairo, told Al Jazeera the attack "fits the pattern of ISIS attacks".

"Potentially, it's another attack against Sufis in northern Sinai. Potentially, it's retaliation for tribes co-operating with the state in the crackdown on ISIS," he said, using another name for ISIL.

Kaldas said ISIL has been "more willing to target civilians, as we saw with a lot of attacks on the Egyptian-Christian community in the past year".

Egypt has for years been battling an armed anti-government campaign in the rugged and thinly populated Sinai Peninsula, which has gained pace since the military overthrew democratically elected President Mohamed Morsi of the Muslim Brotherhood in mid-2013.

In 2014, following a suicide bombing that killed 33 soldiers, Sisi declared a state of emergency in the peninsula, describing it as a "nesting ground for terrorism and terrorists".

'Scorched earth strategy'

Kaldas said many people have criticised the Egyptian government's "scorched earth strategy" in Sinai, but conceded that the area is "very challenging terrain".

"It's a mountainous desert area that's not very developed. Even with the best strategy, it's a difficult place to control."

{articleGUID}

Local news media reported the closure after Friday's attack of the El Arish-Rafah road, further east.

The attack also came a day before the Rafah border crossing, the main gateway for Palestinians in the besieged Gaza Strip to the outside world, was due to open for a three-day period.

The border opened briefly earlier this week.

The mosque massacre prompted condemnations from across the world.

Jens Stoltenberg, NATO secretary-general, called the attack "barbaric" while Theresa May, British prime minister, described it as an "evil and cowardly act".

US President Donald Trump condemned the massacre as "horrible and cowardly".

"The world cannot tolerate terrorism, we must defeat them militarily and discredit the extremist ideology that forms the basis of their existence!," he wrote on Twitter.

Turkey, Italy and Kuwait also condemned the attack.