CAIRO — An Islamic State affiliate on Wednesday claimed responsibility for a missile attack the previous day that targeted an airport in Egypt’s northern Sinai Peninsula during an unpublicized visit to the facility by the defense and interior ministers.

In a brief statement circulated on jihadi websites, the group said the intended target of the “guided” missile it fired at the el-Arish airport on Tuesday was the two ministers, and that the projectile struck an Apache helicopter that was part of their entourage.

The statement, carried by the IS-run Aamaq news agency, could not be independently verified but resembled previous claims by the group that were widely seen as credible.

Earlier Wednesday, security officials said Egyptian forces clashed with Islamic militants near the el-Arish airport. Five militants and an army captain were killed in the fighting. The officials spoke on condition of anonymity because they were not authorized to brief the media.

Defense Minister Sedki Sobhy and Interior Minister Magdy Abdel-Ghaffar, who is in charge of police, were in el-Arish on an unannounced visit when Tuesday’s attack took place, according to a brief military statement.

It said an officer was killed and two others were wounded in the attack, which also damaged a helicopter. It did not say whether the two ministers were at the airport at the time.

President Abdel-Fattah el-Sissi met with both ministers in Cairo on Wednesday, according to presidential spokesman Bassam Radi. The presidential office released a photo of the meeting in which both ministers looked unharmed as they sat grim-faced with el-Sissi and several other top military and intelligence officials.

Egyptian security forces have been battling Islamic militants in Sinai for years, but the violence spread and intensified in 2013 after the military overthrew Mohammed Morsi, a freely elected Islamist president whose one-year rule proved divisive. The region is now home to a powerful Islamic State affiliate that has claimed a number of large attacks.

The attack on the airport, at a time when the city was highly secured for the ministers’ visit, pointed to enhanced intelligence and military capabilities on the part of the insurgents. Such official visits are planned and carried out in secret, with no live media coverage. The government has heavily restricted journalists’ access to northern Sinai since 2013.

El-Sissi, who as defense minister led Morsi’s overthrow, has ordered security forces to restore “security and stability” in Sinai by the end of February, telling them to use “brute force” to crush the militants.

Those orders came after an attack on a mosque in northern Sinai last month that killed more than 300 worshippers. The Nov. 24 attack was the deadliest against civilians by Islamic extremists in Egypt’s modern history. Among the dead were 27 children.