Photo

As Israel began an attack on Gaza on Wednesday , killing a top military commander of Hamas, the government also took to Twitter to live-tweet the strike as it unfolded.

@IDFSpokesperson, the official Twitter account for the Israel Defense Forces, sent more than 25 messages over five hours as the attack occurred. The account also shared videos taken from the helicopter that killed Ahmed al-Jabari, Hamas’s top military commander, and warned of other attacks should Gaza retaliate.

Israeli officials even started their own hashtag for the strike, #PillarOfDefense.

“The IDF has begun a widespread campaign on terror sites & operatives in the #Gaza Strip, chief among them #Hamas & Islamic Jihad targets,” the Israeli military said on Twitter as the strike began.

This was followed by updates of the attack, including a 10-second video that showed Ahmed al-Jabari’s car being blown up as it traveled down a Gaza street. Officials then shared a link to the official I.D.F. blog, which explained who Mr. Jabari was and why the attack was important to Israel.

A Twitter message from the I.D.F. that warned other Hamas members, “whether low level or senior leaders,” not to show their heads in the coming days, was retweeted more than 2,500 times.

Terrorist organizations have long used Twitter and other social media sites to share their own accounts of attacks or hostage-takings. During the Iraq war, insurgents shared videos on Live Leak, another social video site, of homemade bombs that were used against the American military and video of snipers who had shot and killed United States Marines. But this was most likely one of the first times that a government organization had taken to Twitter to announce a military attack as it unfolded.

An Arabic Twitter account believed to be run by the Alqassam Brigades, the well-armed organized military wing of Hamas, responded to the I.D.F. on Twitter saying, “Our blessed hands will reach your leaders and soldiers wherever they are (You Opened Hell Gates on Yourselves).” The Alqassam Brigades has also been updating its Twitter account to describe areas in Israel it is attacking with projectiles.

The Hamas information Twitter feed, also said to be a Twitter account for Hamas, did not respond to the I.D.F. Twitter account. It is also not verified as an authentic account.

“There are 2 main goals of this IDF operation: to protect Israeli civilians and to cripple the terrorist infrastructure in the # Gaza Strip,” the I.D.F. wrote.

After the attacks concluded, the I.D.F. sent a Twitter message that said: “Ahmed Jabari: Eliminated.”