MOGADISHU, Somalia — Two car bomb blasts in Somalia’s capital killed at least 18 people on Friday and shattered a monthslong period of calm in Mogadishu. The Shabab extremist group claimed responsibility for the attack.

The explosions came a day after Somalia’s interior minister warned of an explosives-laden vehicle somewhere in the capital.

The first explosion occurred near the country’s intelligence headquarters, police Capt. Mohamed Hussein said. He said the second occurred near Parliament’s headquarters, where a vehicle tried to speed through a checkpoint.

Mogadishu was the target of a truck bombing in October that killed 512 people, the deadliest attack in the Horn of Africa and one for which the Shabab was blamed.