(Adds French visit to site of bombing)
By Marie-Louise Gumuchian and Ghaith Shennib
TRIPOLI, April 23 (Reuters) - A car bomb in Tripoli wounded two French guards at France's embassy in Libya on Tuesday, bringing new violence to a capital that has not seen attacks on diplomats like that which killed the U.S. ambassador in Benghazi last year.
Since Muammar Gaddafi was toppled by Western-backed rebels in late 2011, Tripoli, like the rest of the sprawling desert state, has been awash with weapons and roving armed bands, but violence in the city has not targeted diplomats before in the way Western envoys have been shot at and bombed in the east of the country.
"This is an attack that targets not only France but all countries that fight against terrorist groups," Foreign Minister Laurent Fabius said in Paris before flying out to inspect the damage to the embassy.
One of the two wounded French guards required emergency surgery in Tripoli, he added.
Libyan Prime Minister Ali Zaidan joined him at the scene of the explosion and together they also visited the damaged homes of residents nearby.
Security will be stepped up across a region where France has taken a leading role of late, first in pushing for a NATO air campaign to defend the Benghazi-based rebels from Gaddafi's forces, and most recently mounting its own assault in its former colony of Mali against Islamist insurgents who have profited from arms and fighters coming over the Sahara border from Libya.
President Francois Hollande said: "France expects the Libyan authorities to shed light on this unacceptable act so that the perpetrators are identified and brought to justice."
Libya's government, struggling to exert its authority, said it was a "terrorist act" aimed at destabilising their country, and ministers said they would work with French investigators.
There was no immediate claim of responsibility in the hours after the early morning blast, which caused extensive damage, but al Qaeda's north African arm, AQIM, threatened retaliation for the French intervention in Mali as recently as last week.
Interior Minister Ashour Shuail told a press conference he could not say whether the strike was linked to the attack on the U.S. embassy in Benghazi last year, but said a commission had been set up to investigate the blast.
The minister added a diplomatic security force would be active in the country within days.
Westerners in the region have been on alert since January's bloody mass hostage-taking at the In Amenas natural gas plant in Algeria, close to the Libyan and Malian frontiers, during which militants demanded Paris halt operations in Mali.
Foreign Ministry spokesman Philippe Lalliot said France had not received any specific threat against the Tripoli embassy but it had been aware of a generally increased risk, adding that the embassy was now out of action and staff would move elsewhere.
He said France had asked Libyan authorities to strengthen security around French institutions, which were now all closed, including a cultural centre and a school.
"This is a very worrying sign for the government," one Western diplomat said. "It will be a further deterrent for companies who have so far been reluctant to come to Libya."
In the chaos following Gaddafi's overthrow and death, there have been attacks on diplomats, notably in Benghazi in the east.
In September, the U.S. ambassador to Libya and three other Americans were killed at Washington's consulate in the city, which is the hub for the lucrative oil industry. U.S. officials say militants with ties to al Qaeda were most likely involved in that attack, but no group has credibly claimed responsibility.
British, United Nations and Red Cross missions in eastern Libya have also been the targets of violence.
Most foreign embassy staff and international aid workers have strict security in Tripoli, and Benghazi remains off-limits to many foreigners.
People living near the French embassy compound, in Tripoli's Hay Andalus area, close to the Mediterranean seafront, said they heard two explosions at around 7 a.m. (0500 GMT).
Tripoli police chief Mohammed Sharif said "an explosive device was planted in a car parked outside the embassy".
A large part of the wall around the compound collapsed, and one corner of the embassy building had caved in. Office cabinets lay scattered on the ground outside and water from a burst pipe ran down the street. Residents pointed to jagged metal fragments which they said came from a car that had exploded.
One neighbour said his young daughter was taken to hospital after she was hit by a falling piece of masonry at home.
The Libyan army cordoned off the compound as dozens gathered outside. An embassy employee arrived at the scene and burst into tears when she saw the destruction. She was allowed inside to join colleagues and French security staff.
"I was in my house sleeping, when I was woken up by a long explosion. I went to my front door and found that it had blasted out," said Osama al-Alam, who lives next door to the embassy.
"I went into the street and saw smoke everywhere. We heard shooting and went inside the house."
Two cars outside the embassy were burnt out, others damaged. A palm tree in one front garden had fallen onto a roof.
Libyan Foreign Minister Mohammed Abdelaziz condemned "a terrorist act" and announced the formation of a French-Libyan investigation team to probe the incident, state media said.
Deputy Prime Minister Awad al-Barasi, as well as the interior and justice ministers, visited the scene.
"We are in a critical stage, and there are some who want to destabilise Libya," Barasi said. "This will not stop us from moving forward, even though it is painful to see the damage."
AQIM - Al Qaeda in the Islamic Maghreb - said on Friday it would retaliate for France's mission to push Islamist fighters out of the large part of northern Mali they seized last year. (Additional reporting by John Irish and Leigh Thomas in Paris; Writing by Marie-Louise Gumuchian and Jessica Donati; Editing by Alastair Macdonald and Will Waterman)