Libyan protesters join rally Thursday in Tripoli to denounce French military intervention. (Stringer/AFP/Getty Images)

Libya’s U.N.-backed government on Thursday sharply criticized France for sending troops into eastern Libya, declaring it a violation of the nation’s sovereignty.

The statement, on the national unity government’s Facebook page, came a day after France announced that three of its soldiers were killed in eastern Libya while on a mission in apparent operations against the Islamic State.

The revelation was the first official acknowledgment by the French government that its special forces were actively operating in the fractured North African nation, which has been divided between two competing administrations.

A rival to the unity government operates in eastern Libya, where the French mission took place. The United States and Britain also have small numbers of elite forces operating in Libya, but they are said to be assisting militias that support the unity government.

Libya’s Presidential Council demanded an explanation from the French government, emphasizing that it “completely rejected this violation of Libyan soil.”

While it welcomed support in fighting the Islamic State, the government said it should be viewed as a partner and consulted.

Militias loyal to the government, as well as those belonging to its eastern rivals, have laid siege to the Islamic State’s stronghold in the coastal city of Sirte. In recent days, officials and commanders have predicted that the militants could soon be pushed out of the city, although reports suggest that they are putting up stiff resistance.

There are an estimated 2,000 to 5,000 Islamic State fighters across Libya, which has been gripped by unrest and political upheavals since a Western-aided uprising in 2011 deposed longtime ruler Moammar Gaddafi, who was captured and killed by rebels.

France, then under the leadership of Nicolas Sarkozy, was a key player in the 2011 mission.

The Associated Press, quoting Libyan officials, reported that the French soldiers were killed Sunday in an attack on their helicopter. An Islamist militia known as the Defending Benghazi Brigade asserted responsibility for the attack and said the helicopter belonged to Khalifa Hifter, a Libyan general who opposes the unity government.

Demonstrations have erupted in Tripoli and other Libyan cities against French military presence, according to local news reports. Waving Libyan flags, some of the hundreds of protesters carried placards that read: “No French Intervention” and “Get your hands off Libya.”

On Tuesday, the French Defense Ministry declined to confirm the reported details of the soldiers’ deaths. But French President François Hollande, addressing a military training center in southwestern France, specifically mentioned a “helicopter crash.”

The official confirmation of French forces in eastern Libya presented diplomats with a potential headache: France has been a strong supporter of the unity government.

“They’re doing this in Benghazi as they’re doing it elsewhere, as if the political dynamics don’t matter,” said Mattia Toaldo, a senior fellow at the European Council on Foreign Relations, a London-based research institute. “But they do matter.”

In Paris, government spokesman Stéphane Le Foll said in a radio interview Wednesday that French forces in Libya were there to “ensure that France is present everywhere in the fight against terrorism.”

Toaldo said this shed light on the possible political motives behind France’s operation. Hollande, he said, is probably pursuing a domestic political agenda as much as an international one.

“Showing that he’s fighting Daesh is helping much more domestically than helping Tripoli achieve stability,” Toaldo said, using another name for the Islamic State.

Hollande, with approval ratings consistently below 20 percent, is the least popular French president in recent memory, and his tenure has included three major terrorist attacks in France, most recently the truck rampage last week through Bastille Day crowds in the Riviera city of Nice.

The Islamic State described the driver in the Nice attack, Mohamed Lahouaiej Bouhlel, as a “soldier” in its self-proclaimed army, although it remains unclear whether he had direct connections to the terrorist organization.

McAuley reported from Paris.