The foreign ministry said the move was necessary because of the deteriorating security situation.
The ambassador and four other diplomatic staff had left Ukraine with the support of a team of special forces from the Swiss army.
The ministry on Wednesday confirmed reports by several Swiss newspapers and online sites.
The embassy was closed on Monday. It had operated with reduced personnel and resources over the past week.
The foreign ministryExternal link has advised all Swiss citizens to leave Ukraine if possible. Swiss nationals who need assistance are told to contact the foreign ministry helpline by e-mail or telephone.
There were 268 registered Swiss nationals and family members in Ukraine until last Thursday.
However, it is not clear how many of them have already fled the country in the meantime.
More
More
Switzerland backs full EU sanctions against Russia
This content was published on
Switzerland has decided to adopt the full range of sanctions imposed by the European Union against Russia.
Switzerland abstains from vote on Palestinian bid for full UN membership
This content was published on
On Friday, Switzerland abstained from the vote at the General Assembly on granting the Palestinians new rights at the United Nations (UN).
Protein in abdominal fat could help shape obesity treatment
This content was published on
The study analysed fat cells from different locations in the body, and found that those in the abdomen have unique properties.
North African asylum claims fall after rapid Swiss processing
This content was published on
The accelerated procedure, now out of its test phase, has resulted in a significant drop in applications from North African countries.
This content was published on
The artist's song "The Code" focuses on their journey as a nonbinary individual. It is one of the favourites to win this year's contest.
Swiss climate activists block vehicles near Gotthard tunnel
This content was published on
Around ten climate activists briefly blocked the A2 motorway near the northern entrance of the Gotthard tunnel on Thursday.
This content was published on
The Swiss government has advised its citizens against travelling to Ukraine, but it stopped short of asking them to leave the country.
You can find an overview of ongoing debates with our journalists here . Please join us!
If you want to start a conversation about a topic raised in this article or want to report factual errors, email us at english@swissinfo.ch.