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.
Coercion still an issue in Swiss welfare system, report finds
This content was published on
The rights of vulnerable people are still sometimes disregarded by the Swiss welfare system, a national research programme has found.
This content was published on
Viola Amherd has expressed her “deep shock” at the assassination attempt on Slovakian Prime Minister Robert Fico on Wednesday.
This content was published on
A man injured half a dozen people with knives, two of them seriously, before being arrested on Wednesday in northern Switzerland.
Switzerland to introduce flight passenger database
This content was published on
Switzerland plans to introduce a flight passenger database to collect and process personal data in a bid to combat terrorism and serious crime.
Government plans to invest over CHF16bn in Swiss rail network
This content was published on
The federal government intends to invest CHF16.4 billion ($18.1 billion) in railway infrastructure between 2025 and 2028, CHF2 billion more than for the current period.
Swiss to vote on pension reform and biodiversity in September
This content was published on
Swiss citizens will vote on occupational pension schemes and a biodiversity initiative on September 22, the Federal Council announced on Wednesday.
Ukraine peace talks: 50 countries have confirmed participation
This content was published on
To date, 50 countries out 160 invited delegations have confirmed they will attend the Ukraine peace conference, held in central Switzerland in mid-June, according to Swiss public radio, RTS.
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.