CAIRO — The Islamic State group claimed responsibility for a powerful explosion outside the Italian Consulate’s compound in downtown Cairo early Saturday that killed one person and was the first major bombing of a foreign diplomatic mission since the start of an insurgency here nearly two years ago.

The explosion, which occurred about 6:15 a.m., jolted residents awake across the city and brought down slabs of the consulate’s outer walls. Initial reports from state television said the explosion was caused by a car bomb that had detonated near one of Cairo’s busiest intersections and under a major bridge.

A statement by the Islamic State that was circulated on jihadist Twitter accounts on Saturday said the group’s “soldiers” had carried out the attack, using a 450-kilogram car bomb. The statement warned Muslims to stay away from “security dens” because they were “legitimate targets.”

The bombing of a foreign consulate represented a painful milestone for the government in its struggle to contain an expanding insurgency that has mounted a series of recent, spectacular attacks. Over the past few weeks, militants have assassinated the country’s top prosecutor, carried out a large-scale assault on troops stationed in the Sinai Peninsula and tried to attack Egypt’s best-known tourist attractions.