MOGADISHU, Somalia — Militants detonated a car bomb outside the Ministry of Higher Education building in Mogadishu, the capital of Somalia, and then stormed into the building on Tuesday, witnesses and officials said. The attack left at least 19 people dead, including seven attackers, and 15 more were wounded.

The Shabab, an Islamist group in Somalia affiliated with Al Qaeda, claimed responsibility for the assault. The same group attacked Garissa University College in Kenya on April 2, killing 148 people.

Witnesses said the Somali minister of higher education left the building minutes before the attack began on Tuesday. Officials were meeting at the ministry to discuss plans announced on Monday to introduce standardized examinations for the nation’s schools, witnesses and officials said.