Security forces stand alert on the eve of the second anniversary of the revolt that ousted Muammar Gaddafi, in Benghazi. Photo: AP

Security forces were on high alert across Libya on Sunday as the north African nation marks two years since the start of the revolt that toppled Muammar Gaddafi after four decades of iron-fisted rule.

Borders have been closed and some international flights suspended amid fears of a new outbreak of violence.

The anniversary of the uprising that ended with Gaddafi’s killing in October 2011 comes as Libya’s new rulers battle critics calling for a “new revolution” and accusing them of failing to usher in much-needed reforms.

On Friday, thousands of people gathered in the main cities of Tripoli and Benghazi to celebrate the initial February 15, 2011 protest that ignited the revolt two days later.

There is no official programme for Sunday’s anniversary, but the authorities have taken steps aimed at preventing any violence on a day when spontaneous celebrations are expected.

Libya’s borders with Egypt and Tunisia were closed from Thursday for four days, and all international flights have been suspended except at the airports of Tripoli and Benghazi – the cradle of the “February 17 revolution.”

Prime Minister Ali Zeidan said the measures were taken to avoid “any bid to undermine Libya’s security and disrupt celebrations marking the anniversary of the revolution.”

Checkpoints have also been set up across the capital and in Benghazi.

Opposition groups are demanding that former Gaddafi regime officials be barred from holding public office, and a leaflet circulated in Tripoli calls for a “popular revolt” and civil disobedience to bring down the current regime.

It is unclear who is behind the leaflet and the calls for protests, but Libyan officials and several organisations, including Islamic groups, accuse remnants of the former regime of fomenting protests to “sow disorder and instability.”

The authorities have said special permits will be needed for “peaceful protests,” and have threatened force against anyone who tries to derail anniversary festivities.

Residents of Benghazi – which has been hit by Islamist-linked violence targeting international agencies and diplomatic missions – have set up neighbourhood watches.

The city was rocked last September by an assault on the US consulate there that killed US ambassador Chris Stevens and three other Americans.

“Security is one of the challenges the country faces, especially the proliferation of weapons and the escape of thousands of prisoners” during the revolution, political analyst Suleyman Azqim told news agency AFP.

“The new authorities are faced with immediate social demands that prevent them from implementing medium- or long-term economic or security strategies.”

Despite Libya holding its first free elections in July last year, Azqim said the country is not yet politically mature after four decades of dictatorship under Gaddafi.

The fear of fresh violence is strong among both Libya’s dwindling foreign community and Libyans who have rushed to stock up on food and domestic gas.

“We must be ready. One never knows what can happen, particularly since there is no stability in the country and the government is unable to impose its authority,” said one, Murad Abuajila al-Majbri.