A roadside bomb has killed four Egyptian soldiers in the Sinai Peninsula, where the army is battling fighters of the Islamic State of Iraq and the Levant (ISIL), according to the Egyptian military.

One officer and three soldiers died in the attack on their vehicle near the border town of Rafah, a military spokesman said on Facebook on Thursday.

ISIL's affiliate group in Egypt claimed responsibility for the bombing, in a statement posted on one of its Twitter accounts.

The attack came a few days after seven soldiers died in an attack on a checkpoint.

Last week, ISIL-affiliate Sinai Province also claimed responsibility for a rocket attack on an Egyptian naval vessel near the coast of Israel and Gaza, less than a week after claiming a bombing in Cairo that heavily damaged the Italian consulate.

Sinai Province earlier this month assaulted several military checkpoints in North Sinai, in what was the fiercest fighting in the region in years.

Fighters loyal to ISIL have killed hundreds of policemen and soldiers since the army overthrew President Mohamed Morsi in 2013.

The military said it has killed more than 1,000 fighters in Sinai, which borders Israel and the Palestinian Gaza Strip.

President Abdel Fattah el-Sisi has said the group poses an existential threat to Egypt, the most populous Arab country.