After training at sea and some visits to other foreign ports, the Russian warships will head for the Caribbean to hold exercises in November with Venezuela's navy.
The Neustrashimy (Fearless) missile frigate from Russia's Baltic Fleet has also called at Tripoli to replenish supplies.
Dygalo, an aide to the Navy commander, earlier said the frigate would after leaving Tripoli continue its tour of duty via the Mediterranean to the Indian Ocean. "The Neutrashimy will go to Somalia where it will ensure the safety of Russian vessels passing through this area against pirate attacks," he said.
Last week, Somali Ambassador to Russia Mohamed Handule said his country's President Abdullahi Yusuf Ahmed had authorized Russia's military to fight pirates off Somalia's coast and on land.
Pirates are increasingly active in the waters off Somalia, which has no effective government and no navy to police its coastline. The International Maritime Bureau said more than 30 incidents of piracy were registered in the region in 2007. More than 30 attacks have been committed so far this year off the coast of the East African nation.