CAIRO — Egyptian security forces killed at least 40 people suspected of being militants in North Sinai and Giza, officials said on Saturday, a day after an explosion hit a tour bus, leaving four people dead and 10 others wounded.

The Ministry of Interior did not explicitly link the killing of the suspected militants to the attack on the tour bus on Friday, in which an improvised device hidden in a wall less than 2.5 miles from the pyramids at Giza exploded and killed three Vietnamese tourists and their Egyptian guide.

The ministry said in a statement that security forces had learned that “a number of terrorists” had “planned a series of attacks that targets state institutions, tourism, armed forces, police, and Christian places of worship.”

The security forces simultaneously raided two sites on the outskirts of Giza on Saturday, killing 30 militants there, as well as another refuge in Arish in North Sinai, killing 10 more in shootouts.