A day after surviving an apparent assassination attempt by suicide bombing that claimed the lives of at least six others, Somalia's prime minister publicly responded to his al Qaeda-allied would-be murderers, saying the attack showed the "desperation" of a losing terrorist cause.

"I was at the National Theater in Mogadishu yesterday, and witnessed the despicable terrorist attack by a suicide bomber in which more than six people were killed -- including two of the country's dearest sporting heroes," Abdiweli Mohamed Ali wrote in an article titled "We're Winning This Fight" for Foreign Policy. "Seeing first-hand the appalling loss of life and harm done to my countrymen was a savage reminder of what is at stake in Somalia."

"By resorting to indiscriminate terrorism, as we saw yesterday, [the terrorists] prove that they are desperate, looking for any means to impose their tyrannical will on Somalis. Every day, they are losing more ground..." he wrote.

A camera that was rolling at Mogadishu's National Theater captured the moment the bomb went off -- just as Ali had taken to the podium to give his remarks at a ceremony for the anniversary of a Somali television station. He and other top government officials survived, but several civilians, including two major Somali sports figures, died in the attack, according to Somali and American officials. Witnesses said the bomber was a young girl, an American State Department official told ABC News.

"This operation wasn't carried out by [a] female as they allege but everything was carefully planned & orchestrated by specially trained unit," a spokesperson for the group said on Twitter. The spokesperson said the explosives had been planted in the theater before the gathering and boasted the blast brought "the show to an end."

Somalia's National Theatre was opened for the first time in more than 20 years just two weeks ago. At the opening ceremony, hundreds gathered under the open sky because the roof had been destroyed in the course of the country's ongoing civil war, Voice of America reported at the time. Somalia's president Sheikh Sharif Sheikh Ahmed said the opening of the theater was a result of recent gains in the fight against al-Shabaab.

In his editorial today, Ali said that despite the bombing, al-Shabaab appeared on the ropes.

"Al-Shabaab, the principal obstacle to peace, is under pressure as never before and is tearing itself to pieces," he wrote.

Last month, one of al-Shabaab's most high-profile American members, the Alabama-born Omar Hammami, also known as al-Amriki, appeared in a video that was posted online in which he said he feared other members of the terror group were going to kill him over "matters of the strategy." Just days ago, another major al-Shabaab leader publicly criticized the group publicly for killing civilians.