The Algerian leadership initially supported Col Muammar Gaddafi in his fight against the rebels, but their continued backing of the tyrant is likely to become a political liability, experts warned.
Col Gaddafi’s wife Safiya, his sons Mohammed and Hannibal, and his daughter Aisha, fled across the Algerian border in an armed convoy on Sunday night, and are now thought to be in the capital, Algiers.
The Libyan rebels have said that harbouring the family members is an “act of aggression” but the Algerians also face opposition from their own population and from al-Qaeda in the Islamic Maghreb (AQIM), sworn enemies of Gaddafi.
An Algerian Interior Ministry source said they had put 30,000 men on the streets of Algiers alone, including an extra 20,000 police.
“Security has been stepped up significantly because of the possibility of a massive terrorist attack,” the source said.
“A top priority will be the protection of the Gaddafi family, especially as Libyan rebels may try and pursue them here. For this reason they are in a top security area of Algiers.”
Algeria and Libya have had a lot in common as autocratic regimes, rich in oil with significant problems from al-Qaeda linked extremists.
But while Libya has seen a prolonged uprising against the regime in recent months, the Algerian leadership has managed to make enough concessions to quell much of the dissent that began at the end of last year.
Their history of a bloody civil war in the 1990s between the military-backed government and Islamist extremists, led to the deaths of up to 200,000 people and may have lessened the appetite for an uprising so far.
However, only last Friday 18 people were killed when AQIM suicide bombers attacked the Cherchell military academy, 80 miles west of Algiers, protesting against Algeria’s support for the Gaddafi regime.
Michael Willis, an expert on Algerian politics at Oxford University, said: “Algeria reached a modus vivendi, as many other Arab states did, with the Gaddafi regime but they may want to move away from that.”
The support of the military in Algeria for Col Gaddafi in Libya was based on a concern about Islamist elements of the rebel uprising and unhappiness of the role of Nato.
The regime has been accused of supplying arms and mercenaries to the Gaddafi government, claims they deny.
At the same time Algerian security officials have highlighted the dangers of weapons looted by the rebels falling into the hands of AQIM.
However, Algeria still has significant problems, such as poverty, unemployment and political alienation, which could spark a return of protests to the streets.
Part of the problem has been a political stalemate caused by the illness of President Abdelaziz Bouteflika, who has stomach cancer, and on going struggles between civilian factions in the government and military factions, led by Gen Toufik Mediene, head of the Algerian intelligence and security agency.
“They are both revolutionary regimes dating back to the 1960s, and to begin with the Algerians were keen not to see another regime fall in the Middle East but as they realise Col Gaddafi’s period of control is over, they may be keen to find a solution.
“The problem is that there has not been much direction at the top of the Algerian state and they don’t seem to have thought through this policy,” said Mr Willis.
Algeria has genuine concerns about the spread of al-Qaeda’s influence and a dislike of foreign intervention, according to Shashank Joshi, of the Royal United Services Institute (RUSI).
“They wanted Gaddafi to win for the stability of the region but they cannot be oblivious to the dangers of accepting Gaddafi himself into Algeria,” he added.
“They have been relatively untouched by the Arab Spring but these things are unpredictable and that could change.”