"Due to the change in the security situation in Libya and the great security risk it poses... our embassy has stopped functioning temporarily and has been evacuated," Foreign Minister Ahmet Davutoglu said Monday.
The decision to close the mission was made late Sunday, he said, adding that the ambassador and his staff had already arrived in Tunisia.
"Of course, this does not mean that Turkey will halt its efforts" to resolve the turmoil in Libya, Davutoglu said.
Demonstrators Sunday torched British and Italian diplomatic buildings in Tripoli after Libya accused NATO of trying to assassinate Muamer Gaddafi in an attack that killed one of his sons and three young grandchildren.
Preparations were under way Monday for the funerals.
NATO vowed more strikes, although the operation commander stated "we do not target individuals."
Turkey, the alliance's sole Muslim-majority member, has refused to take part in the air raids, contributing six military vessels to a patrol mission enforcing a UN-mandated arms embargo in Libyan waters.
It has also undertaken several humanitarian aid operations, including the evacuation of more than 300 wounded Libyans for treatment in Turkey.
Ankara has proposed a "roadmap" to end the turmoil, urging an immediate ceasefire, the lifting of sieges by regime forces of rebel-held towns and the initiation of a "transformation process" that would lead to free elections.
The proposal, which stopped short of openly calling for Kadhafi's departure, has so far failed to produce any visible results.
Turkey also has a diplomatic mission in the rebel stronghold of Benghazi.