Egypt should consider the possibility of a military response to the unrest in neighbouring Libya, one of the country's elder statesmen has argued, prompting speculation in Egyptian media that Cairo is mulling an armed intervention.

Amr Moussa, Egypt's former foreign minister and former secretary-general of the Arab League, said in a statement on Sunday that the current upheaval in Libya, which lies on Egypt's western border, had major implications for Egyptian national security.

"The situation in Libya is a major concern for Egypt, Libya's neighbouring countries, and the Arab world at large," Moussa said.

"Statelets, sects and extremist factions in Libya directly threaten Egypt's national security. I call for a broad public debate to sensitise public opinion to the risks, and to build the necessary support in case we have to exercise our right to self-defence."

Moussa's prominence - and his closeness to Egypt's president, Abdel Fatah al-Sisi, for whom he has at times acted as an unofficial mouthpiece – has led to speculation that an Egyptian offensive in Libya is on the table.

"Libya burns, and Egypt approaches a military solution", read the front page of al-Masry al-Youm, one of the country's largest private broadsheets.

Not everyone, however, was convinced. "A seasoned politician should know the limits of state intervention in other countries, even if they represent a threat to us," the security analyst and former army officer Khaled Okasha told al-Watan newspaper.

Moussa's statement builds on Egyptian fears that factional fighting in Libya, which has forced most western diplomats to flee the country, could spill over the border. Last month, those fears were compounded by the killing of 21 Egyptian soldiers near the border with Libya.

Concerns have been deepened in recent days by 13,000 Egyptian migrant workers who have fled to Libya's Tunisian border, many with frightening stories of their treatment by Libyan militias.

The upheaval has strengthened Sisi's position in Egypt, where his supporters believe strong leadership is the only alternative to the chaos in Libya and Syria, even if it comes at the cost of everyday freedoms.

Egypt's foreign affairs spokesman declined to comment on Moussa's statement. Another government source said they knew of no immediate plans to intervene in Libya.