TUNIS (AFP) - A series of attacks in Tunisia claimed by the Islamic State in Iraq and Syria (ISIS) group that killed dozens of people including foreign tourists was planned in neighbouring Libya, a top official said Friday.
The militant group has said it was behind a suicide bombing in the centre of Tunis on Tuesday in which 12 presidential guards died.
ISIS also claimed two attacks earlier this year at the National Bardo Museum in Tunis and on a hotel near the Mediterranean resort of Sousse that killed a total of 60 people, all but one of them foreign tourists.
"Everything is being planned in Libya," Tunisia's secretary of state for national security, Rafik Chelly, told private Mosaique FM radio.
"The commanders of Tunisian terrorist groups are in Libya," he added.
ISIS, which controls swathes of Syria and Iraq, has exploited the chaos that spread across oil-rich Libya after veteran leader Moamer Kadhafi was toppled and killed in its 2011 revolution.
"Libya has become a danger. That's why we have to take precautions... audacious decisions," said Chelly.
British Foreign Secretary Philip Hammond acknowledged that Libya posed a "threat", during a visit Friday to Tunis where he met his Tunisian counterpart Taieb Baccouche and other officials.
"Your minister mentioned the challenges in your neighbour Libya and we are acutely conscious of the threat that your country faces from what's going on in Libya," he said after meeting Baccouche.
Hammond also pledged that Britain would work with Tunisia "on border security... (and) a long term solution for Libya and the defeat of Daesh (ISIS) in Libya".
Thirty Britons were among the 38 tourists killed in the hotel attack near Sousse and on Friday Hammond attended a ceremony to commemorate the attack and visited the Bardo museum.
Tunisia announced on Wednesday it was closing its land border with Libya for 15 days, with Chelly saying the measure was "temporary" to give authorities time to mull what they should do next.
Tunisia has already built trenches and other obstacles along more than 200km of the 500km-long border with Libya and will also reinforce land and sea surveillance, according to Chelly.
He said the Bardo and Sousse attackers "went to Libya, were trained in Libya".
According to Chelly, they would travel illegally to Libya and receive both "military" and "ideologic" training and would return home to Tunisia to "await instructions".
As for Tuesdays alleged attacker, identified by authorities as Hussam Abdelli, 26, Chelly said he had been arrested in the past for possession of books of "extremist religious orientation".
But Abdelli, who authorities said was a travelling salesman, had been released for lack of proof against him, Chelly said.
The interior ministry has reported several arrests of suspects since Tuesday's attack, including 40 detained overnight Thursday over suspicion of membership in "terrorist organisations".
Interior Minister Najem Gharsalli said Tunisians who return from conflict zones will be held under house arrest - a measure already slapped on 92 "dangerous" suspects, according to the ministry.
Prime Minister Habib Essid has told parliament that some materials used in Tuesday's attack were not available in Tunisia but can be found in Libya.