In a two-issue referendum on Sunday, a majority also voted in favour of granting more rights to same-sex couples in the first time the subject has been put to a national vote in Europe.
About 55% of voters, or 1.47 million people, supported joining Europe's passport-free Schengen zone by 2007, indicating the Swiss favour closer integration with the EU, of which the country is not a member.
Swiss President Samuel Schmid hailed the result as backing for the coalition government's policy of developing closer links with the rest of Europe, but said it would not ignore the large minority that voted against Schengen membership.
"The government sees the people's 'yes' to Schengen as a confirmation of a bilateral approach to Europe," Schmid said in Switzerland's capital, Bern.
The result goes against the prevailing mood in the EU, which is reeling from recent rejections by French and Dutch voters of a proposed constitution for the 25-nation bloc.
Vote of confidence
In Brussels, EU Foreign Affairs Commissioner Benita Ferrero-Waldner and Justice Commissioner Franco Frattini welcomed the vote on behalf of the European Commission.
"The ratification of these association agreements is an important step in the relations between Switzerland and the European Union," Ferrero-Waldner and Frattini said in a joint statement.
"On the one hand, freedom of movement will obviously be facilitated; on the other hand, the cooperation on internal security can be strengthened."
"The ratification of these association agreements is an important step... On the one hand, freedom of movement will obviously be facilitated; on the other hand, the cooperation on internal security can be strengthened"
Statement by EU Foreign Affairs Commissioner Benita Ferrero-Waldner and Justice Commissioner Franco Frattini
The Schengen zone allows travel through all participating countries without border checks.
Under Switzerland's cherished system of direct democracy, the people's consent is required on any major issue, including closer integration with the rest of Europe.
Before Sunday's vote, experts had predicted the rejection of the EU constitution in France and the Netherlands would have encouraged opponents of Schengen.
Opinion polls showed a clear majority in favour of joining the zone had narrowed rapidly before voting day.
The vote is "an important positive signal for Europe at a time when Euro-scepticism - hopefully only temporarily - is gaining the upper hand", said Germany's Interior Minister Otto Schily.
The Swiss government has been in favour of joining the EU and its passport-free area, but many of Switzerland's German speakers - who make up about two-thirds of the population - had opposed greater integration with the rest of the continent.
Samuel Schmid (C) has taken
Switzerland closer to Europe
When Switzerland joins Schengen in 2007, customs controls will remain in place as the country will remain outside the EU.
Security measures could also be stepped up for major events such as the annual World Economic Forum in Davos and football's 2008 European Championships, which Switzerland is co-hosting with Austria.
In the referendum's other issue, a larger majority - 1.56 million people or 58% - were in favour of granting more rights to same-sex couples.
Gay couples vote
The vote means that registered gay couples will receive the same tax and pension status as married couples, but they will not be allowed to adopt children or undergo fertility treatment.
It is the first national vote in Europe on such an issue, although other countries, such as Germany, have passed laws allowing registration of same-sex couples.
The two issues sparked a larger turnout than usual in Switzerland's referendums, which are held three or four times a year.
Some 55.95% of the 4.82 million eligible voters took part, about 10% higher than the average turnout over the past 15 years.