SANA, Yemen — A suicide bomber targeted soldiers rehearsing Monday for a military parade here, killing as many as 112 people and signaling that Islamic extremists may be shifting their focus to Yemen’s capital after weeks of intense battles in outlying provinces with U.S.-backed government forces.

Al Qaeda affiliate Ansar al Sharia claimed responsibility for the bombing in retaliation for American-assisted government offensives against its strongholds in southern Yemen. Unnerved by increasedU.S. military and drone strikes, the militants struck directly at the heart of the new and fragile government of President Abdu Rabu Mansour Hadi.

The attack, in which at least 300 people were injured, was the bloodiest in the capital in years and came a day after gunmen fired on a car carrying three U.S. civilian contractors training the Yemeni coast guard in the Red Sea port of Hudaydah. The Pentagon said the trio suffered minor injuries.

Washington has stepped up military involvement in this battered Arab nation, dispatching at least 20 special operations soldiers to provide satellite imagery and intelligence for strikes against extremists. But lawless mountains and deserts controlled by tribes have become a rugged redoubt for hundreds of Islamist fighters at the crossroads of the Middle East and the Horn of Africa.

The attack on Sana revealed how easily militants can maneuver and exploit the nation’s turmoil. Officials said an assailant dressed in an army uniform detonated a concealed bomb while troops drilled for a national holiday parade scheduled for Tuesday. Bodies and rifles were scattered across Sabin Square and four city hospitals were overwhelmed with the dead and wounded.

Yemeni Defense Minister Nasser Ahmed — who may have been targeted for assassination — was in the square near the presidential palace to inspect the troops but was not hurt. Gunfire erupted after the blast and authorities said two people wearing explosives-laden belts were arrested.

“Blood and body parts covered the square. It was hideous,” said one soldier who asked not to be named. “The image will stay with me all my life.”

A statement posted on an Al Qaeda website said Yemeni officials had been “turned into mercenaries” carrying out U.S. and Western policies. It added: “We will get revenge.... What happened in Sana is only the beginning.”

Hadi responded to the attack by firing two top commanders, including the nephew of former President Ali Abdullah Saleh, who was deputy director of national security. In an address to a stunned nation Monday night, Hadi said the “war against terror will continue until terror is uprooted and terminated, regardless of the sacrifices.... We are determined to clear Yemen of extremists and free ourselves to face our economic and development challenges.”

The bombing came days after Yemeni forces launched major operations against militants linked to Ansar al Sharia and the group Al Qaeda in the Arabian Peninsula. Authorities said 19 soldiers and 33 militants were killed in weekend clashes in the south. Earlier this month, a U.S. drone strike killed Fahd Mohammed Ahmed Quso, an Al Qaeda operative believed to have plotted the bombing of the U.S. destroyer Cole in 2000 that killed 17 American sailors.

The militants had promised on their website to retaliate, calling their strategy a “flowing river” that will sweep across the impoverished country. Much of the Al Qaeda affiliate’s focus has been in the south, including Abyan province, where police stations have been overrun, officials assassinated and towns seized. The tactics have frustrated Yemen’s underpaid, ill-equipped army, which has been manipulated by political forces.

Islamic militants have rattled the government since Hadi’s inauguration day in February, when a suicide bomber killed at least 25 people, mostly soldiers, at a presidential palace. Washington fears increased efforts by Yemeni extremists to attack U.S. targets similar to the failed plots in 2009 and this month to blow up airliners over Western skies.

The nation is also rife with intrigue. Saleh ruled for 33 years and his authoritarian approach has been blamed for much of the country’s instability. His negotiated departure this year after months of uprisings left his political machine in place. Hadi is attempting to keep Saleh at bay while dealing with poverty, power shortages and international pressure to defeat militants.

Al Qaeda had largely ignored Sana until now. If Monday’s bombing is a precursor to more attacks, it would further threaten security in a capital already roiled by tribal conflicts, northern-based rebels and divisions within the armed forces, including a military unit in the Central Security Organization led by another of Saleh’s nephews. Officials worry the ancient city could descend into a battle that would spark a civil war.

jeffrey.fleishman@latimes.com

Special correspondent Al-Alayaa reported from Sana and Times staff writer Fleishman from Cairo. Staff writer Ken Dilanian in Washington contributed to this report.