SANAA, Yemen — A suicide bomber detonated his explosives-laden car Thursday at Yemen’s Defense Ministry, killing 15 soldiers and wounding at least 40 in an attack underlining the persistent threat to the stability and security of the impoverished Arab nation, military and hospital officials said.

Officials said as many as 12 gunmen also were killed in a firefight between troops and a carload of attackers who arrived minutes after the early morning blast, apparently in a bid to take over the complex in downtown Sanaa, Yemen’s capital.

They said the gunmen were armed with assault rifles, hand grenades and rocket-propelled grenades. They wore Yemeni army uniforms, the officials said.

There was no immediate claim of responsibility for the attack, which bore the hallmarks of al-Qaida, whose chapter in Yemen is considered among the world’s most active.

The Defense Ministry issued a brief statement confirming Thursday’s attack. It said “most” of the gunmen had been killed, but did not say how many there were or give any other details.

The officials said the blast badly damaged a hospital inside the complex, started a fire and blew out windows and the doors of homes and offices in the immediate vicinity. The blast and the subsequent gunfight destroyed an armored vehicle belonging to the army and reduced three civilian cars outside the complex to charred skeletons, witnesses said.

The officials spoke on condition of anonymity because they were not authorized to speak to journalists.

The wail of police and ambulance sirens and the sound of assault rifles fire could be heard on AP video. The video also shows armored personnel carriers and additional soldiers arriving near the ministry.

Military helicopters hovered over the site after the blast and state television aired calls for blood donations.

Al-Qaida militants are concentered in the southern and eastern parts of Yemen, but they occasionally strike in the capital. They took advantage of the tenuous security prevailing in 2011 and 2012 during an uprising against then-President Ali Abdullah Saleh by seizing territory in the south.

Yemen is strategically located at the southwest corner of the Arabian Peninsula, bordering Oman and Saudi Arabia, two of Washington’s closest Arab allies. Yemen has a shoreline on the Red Sea and the Arabian Sea close to the vital shipping lines carrying oil from the energy-rich Gulf region to the West.

Yemen’s defense minister was in Washington on Thursday for talks with U.S. officials.