The twin-bore Gotthard base tunnel now holds the title of being the world's longest and deepest one.
It measures 57 km in length (35-mile) and is situated 2.3 km deep under the Swiss Alps. It will provide a high-speed rail connection under the Alps between northern and southern Europe.
Switzerland says that this will have a great impact on European freight transport.
The tunnel is longer than Japan’s 53.9 km Seikan rail tunnel and also the 50.5 km Channel Tunnel, which links the UK and France, placing them respectively into second and third place.
"It is a giant step for Switzerland but equally for our neighbours and the rest of the continent," Swiss Federal President Johann Schneider-Ammann said in a speech to guests in Erstfeld, close to the northern entrance of the tunnel.
A speech by the Swiss federal transport minister, Doris Leuthard, was carried by a live relay from the southern end of the tunnel in Bodio.
After the speech, two trains were launched into opposite directions through the tunnel, each of them carrying hundreds of guests who won tickets for the ride. The route was then officially opened.
The rail project cost more than $12 billion to build.
German Chancellor Angela Merkel, French President Francois Hollande, Italian Prime Minister Matteo Renzi and Austrian Chancellor Christian Kern were expected to take part in the grand opening along with Swiss officials.
With the new railway tunnel, Europe’s goods will be able to cross the Alps in a much quicker, safer and cheaper way.
"It is just part of the Swiss identity," federal transport office director Peter Fueglistaler told Reuters.
"For us, conquering the Alps is like the Dutch exploring the oceans," he added.
The project was voted for by Swiss voters in a referendum in 1992.
Afterwards, voters supported a proposal from environmental groups to move all freight that travels through Switzerland from the road to the rail system two years later.
The route of the tunnel goes down 2.3 km below the surface of the Alps, above and through rock that reaches temperatures of 46C.
While carrying out construction, engineers had to dig and break through 73 different varieties of rock, some were extremely hard, while others were soft. Over 28 million tonnes of rock was dug up.
Nine engineers lost their lives during construction.
The completed tunnel will create a mainline rail connection between Rotterdam in the Netherlands and Genoa in Italy.
When the train is opened to passengers in December, the journey time between Zurich and Milan will be reduced by an hour to two hours and 40 minutes.
Approximately 260 freight trains and 65 passenger trains will pass through the tunnel in just 17 minutes.
Value-added and fuel taxes, road charges on heavy vehicles and state loans set to be repaid within a decade finance the tunnel.