Tunisia museum attack
A tourist injured after an attack by gunmen on Tunisia\'s national museum is wheeled on a stretcher in Tunis Reuters

Following the attacks on Tunis's Bardo museum that killed 21 people on 18 March, Islamic State (Isis)-linked accounts on social media were flooded with messages of glee and triumph, supporters pouring forth messages of jubilation at the massacre of so many foreign tourists. Before long, IS had claimed responsibility for the atrocity.

The attack certainly didn't come out of nowhere. It came after various releases in recent months by IS and its supporters, aimed at recruiting Tunisians and inciting attacks. IS officials, supporters and fighters have been urging for an attack in Tunisia in the group's name for a while now.

On 15 March, IS released a video of a fighter in Raqqa providing advice to fighters in Boko Haram and then stated Tunisian jihadists should follow in the group's footsteps. The message said:

On the same day, jihadi media group Afriqiyah Media responded with a message attributed to Jund al-Khilafah in Tunisia, the same alleged group attributed to a December 2014 audio recording of a pledge to IS leader Abu Bakr al-Baghdadi. The 15 March message stated in part:

The next day, Afriqiyah Media released a statement that Tunisian rapper "Emino" (AKA Marwen Duiri) had joined IS in a message released on Twitter. The statement claimed:

Tunisian rapper
Tunisian rapper Emino SITE

The message also stated:

On the eve of the Bardo museum attack, one social media account appeared to presage the massacre. Its author tweeted in Arabic:

The user also included a hashtag translating to "#Invasion_ofTunisia" in the message, which was tweeted nearly 6,000 times in the first few hours of its creation.

Another IS-linked account tweeted:

Accounts of IS fighters and supporters have also begun disseminating a December 2014 video urging Tunisian Muslims to pledge to Baghdadi and perform attacks.

Entitled "A Message to the People of Tunisia", the video called for Muslims to "revive the tradition of assassination in Tunisia" and invoked Kamel al-Gathgathi and Lutfi al-Zayn, the killers of Tunisian politicians Chokri Belaid and Mohamed Brahmi.

Rita Katz is executive director of the SITE intelligence group (www.siteintelgroup.com). She has been monitoring terrorist activity and Jihad for more than a decade.

You can find her on Twitter @rita_katz.