(Reuters) - An explosion outside the Algerian embassy in Libya's capital Tripoli on Saturday slightly wounded two guards and damaged nearby vehicles, officials and residents said.

Algeria and most other countries evacuated their diplomats in the summer during fighting between rival factions who are battling for control of the oil-producing North African state three years after the fall of Muammar Gaddafi.

Two guards suffered minor wounds by the blast, officials in Tripoli and Algeria's state news agency said. Libya's recognized government, which has been forced to work out of a rump state in the east, denounced the explosion in a statement as "cheap attempt" to undermine U.N.-sponsored peace talks which started this week in Geneva.

Tripoli is now controlled by a faction called Libya Dawn, which has set up a rival government.

The eastern-based government is recognized by the United Nations and Western powers. The Tripoli administration is not, but still controls ministries, airports and some oil facilities.

The U.N. talks are aimed at forming a unity government, ending hostilities and putting a transition to democracy on track. But the Tripoli-based forces say the process had been rushed, and plan to vote on Sunday on whether to attend.

Fighting over the country's oil infrastructure has closed two major oil ports in the east and slashed Libya's oil output to around 300,000 barrels per day from the 1.6 million bpd produced before the civil war toppled Gaddafi in 2011.

Bombs exploded in November near the Egyptian and United Arab Emirates embassies.

(Reporting by Tripoli staff; Writing by Patrick Markey and Ulf Laessing; Editing by Alison Williams)