The closing follows similar actions by other countries as fighting in Libya grows more intense. In the last three weeks, Libya has descended into its deadliest violence since the 2011 war that ousted MoammarGadhafi.
On Saturday, the United States also removed its diplomats from Tripoli to neighbouring Tunisia and shut its embassy.
Foreign Affairs Minister John Baird and Lynne Yelich, minister of state for foreign affairs, said in a statement that Canadian diplomats will do the same, operating from Canada's Embassy in Tunis, Tunisia, where consular and passport services will be available to Canadians remaining in Libya.
“The government of Canada takes the safety and security of our diplomats abroad very seriously," Baird's statement said.
It also indicated an intention to return to Libya once "appropriate measures are put in place to respond to the changing operational environment."
The statement added: "Canada remains committed to supporting Libya's democratic transition, and we urge all parties to stop the violence and resolve their differences by peaceful and democratic means."