Tunisian officials say the two gunmen who killed 21 in attack on the country's national museum had trained at a militant camp in neighboring Libya.
The assault took place at the renowned Bardo museum on Wednesday and all but one of the victims were foreign tourists. It was the worst such incident since autocrat Zine El Abidine Ben Ali was overthrown in 2011's Arab Spring uprising.
Tunisian authorities said Thursday that the two suspects — identified as Yassine Abidi and Hatem Khachnaoui — were both "probably" Tunisian nationals who left for Libya at the end of 2014 before returning as part of a "sleeper cell."
"They left the country illegally last December for Libya and they were able to train with weapons there," Secretary of State for Security Rafik Chelly said in a television address, according to an AFP translation. He added that Abidi has was known to authorities, and had been arrested before making his way to Libya.
Chelly added that there were suspected training camps in the Libyan cities of Benghazi and Derna and that similar cells had been set up in different parts of Tunisia. Nine others were arrested for suspected involvement with Abidi and Khachnaoui's group, Tunisian President Béji Caid Essebsi said.
The Islamic State (IS) militant group claimed responsibility for the attack in an audio recording released on Thursday and which went on to praise the two attackers and threatened further violence. "What you have seen is only the start," the statement warned. Links between IS and the attackers have not yet be confirmed, however.
Senior American army commander Gen. David Rodriguez, who heads US Africa Command, said in December that IS had set up training camps in eastern Libya.
Tunisia is a leading recruitment pool for IS and as many as 3,000 of its citizens have joined the group to fight in Iraq, Syria, and Libya, according to authorities.
The country has had longstanding problems with Islamic extremism, particularly since Ben Ali was removed from power, but it remains arguably the Arab Spring's sole success and leaders are looking to solidify its democratic transition.
Libya, however, has sunk into chaos since longtime autocrat Muammar Qaddafi was overthrown and killed in 2011 with the help of an international coalition. It is now held together by a complex array of militias representing different religious, nationalist, and regional interests.
Disagreements over last June's general election turned Islamist and nationalist factions against each other, however, triggering an ongoing crisis that has left the country in turmoil. One government, the Tobruk-based Council of Deputies is internationally recognized and was set up after the elections as a replacement for the interim General National Congress (GNC) that governed after Qaddafi's ouster. However, the Islamist factions that had dominated the GNC fared badly in the voting and refused to accept the Council of Deputies' authority so set up a rival government in the capital Tripoli.
Islamist and nationalist militias have since clashed for control of the country in an ongoing crisis that has killed hundreds and displaced tens of thousands. IS has taken advantage of the chaos to carry out attacks and expand its influence, and a number of militants in the region have pledged allegiance to the organization, including Derna's Ansar al Sharia group, which did so in October.
IS has since claimed responsibility for a number of attacks in Libya, including a January strike on a luxury hotel in Tripoli favored by diplomats and business travelers that killed nine. It also released a gory propaganda video in February showing its fighters murdering 21 Coptic Christians, most of which were Egyptian migrant workers.
Militias loyal to the Tripoli government have also clashed with IS in the extremist stronghold of Sirte and at least 12 militiamen were killed in fighting this week.
Mohamed al-Dayri, foreign minister of the Tobruk government, congratulated his Tripoli-based rivals for battling IS, saying he "welcomed favorably the course taken by factions of Fajr Libya who are fighting the Libya branch of IS in Sirte," according to AFP.
It comes ahead of UN-brokered talks between the rival sides to form a unity government taking place Friday in Morocco. UN special envoy Bernardino Leon said the museum attack made the timing of the talks and a move toward stability in Libya especially important. "[The attack is] another alarm to take into account ... it adds a sense of urgency," he said in remarks carried by AP. "This should be a decisive moment because we are running out of time."
Follow John Beck on Twitter: @JM_Beck