Ana Portet has had an unusual commute to work. At 7.30am she popped down to Sants railway station in Barcelona. Three hours later she was in a meeting with colleagues from her brewery firm, 315 miles away in Madrid.

"I'll be back in Barcelona by half past five," she said as her early afternoon bullet train flew back along the new high-speed tracks at up to 210mph. "It's so quick, sometimes you are there before you have even noticed."

Portet is one of hundreds of thousands of travellers who have migrated from the world's busiest air shuttle, linking Madrid and Barcelona, to what is now Spain's most popular train, the high-speed AVE.

The AVE, an intercom announcement has just told us, will leave us in the centre of Barcelona in two hours and 32 minutes. With Madrid's AVE station a short walk from the Prado museum, the journey is from one city centre to another. What is more, the high-speed train does this in punctual, hassle-free and elegant style.

High-speed trains pulled by aerodynamic engines with noses shaped like a duck-billed platypus are grounding aircraft across Spain. The year-old Barcelona-Madrid line has already taken 46% of the traffic – stealing most of it from fuel-guzzling, carbon-emitting aircraft. As the high-speed rail network spreads a web of tracks across Spain over the next decade, it threatens to relegate domestic air travel to a distant second place.

A high-speed network is not designed overnight. Spain's AVE story started in the 1980s, when the socialist prime minister Felipe González commissioned a line between Madrid and his home city of Seville. The project was overshadowed by corruption scandals and greeted with a certain amount of scorn. Why was sleepy Seville getting the line and not busy Barcelona? Some saw it as an expensive white elephant and a monument to González's ego.

The line, however, was a spectacular success. Remote Seville was suddenly two and a half hours from Madrid. Spaniards, used to shabby, lumbering trains that crawled across the countryside following unpredictable timetables, discovered their trains could be stylish and run on time.

Previously the choice on the Madrid-Seville run was between a hot, tiring six-hour coach journey or an aircraft. Seventeen years later, only one traveller out of 10 takes the plane to Seville. The rest go by a train that is 99% punctual. The Seville line proved that high-speed trains could be part of the answer, albeit an expensive part, to some of Spain's most enduring problems.

A country almost two and a half times the size of Britain, Spain is traversed by mountain ranges and wide rivers that act as barriers to communication. Those barriers not only stopped many people getting to the biggest cities – with their universities and research hospitals, they also stopped Spaniards finding out about their own country.

EU funds were tapped to help railways and motorways bulldoze their way through these barriers. Spain's vast open spaces and fuss-free approach to planning meant, in theory, that a high-speed network could expand fast. Governments of all colours were keen and regions competed to attract the lines.

Expanding the network, however, took much longer than expected. The Barcelona-Madrid route was only the second major line to open – 16 years after Seville. Financing, political squabbling over priority routes and the unexpected appearance of large holes under part of the Barcelona track kept pushing the inauguration date back.

Now it is as though the Barcelona AVE has always been there. It has already improved the love life of 68-year-old Wenceslao Gomez, who books ahead to get cheap fares as low as €87 (£73) return. "My girlfriend lives in Barcelona and I live in Madrid," he explained as a dramatic stretch of Spanish countryside rushed past. "It's a bit pricy, but I'll never catch the plane again."

Budget airlines offer cheaper prices but the regular air shuttle cannot compete, except on time.

For Balbinder Sandhu, a young British businessman who lives in Barcelona, the choice is clear. "I used to catch the air shuttle with Iberia," he said. "But if I go to Madrid and back on the plane I am usually absolutely knackered. Here we don't have all the airport controls and you can turn up at the last minute."

The prime minister, José Luis Rodríguez Zapatero, a socialist, is reaping the fruits of previous investment and giving the network its definitive push. All over the country, work is going on building bridges, tunnels and laying high-speed track as a further €108bn is poured into the network over the next 12 years.

By 2020 Spain will have Europe's largest high-speed network, its 6,000 miles of track outgunning even France's TGV system. By then 90% of the population will be within 30 miles of a station. New lines have already been opened to Segovia, Valladolid and Malaga in the last 18 months. New links will eventually connect France and Portugal.

Airlines have reacted by claiming the AVE receives unfair government support – and by cutting prices. "Some airlines still have to learn that customer service is included in the price of a ticket," said Josep Valls, a professor at the ESADE business school in Barcelona.

The high-speed train network also helps Spain control carbon emissions, with passengers on the Madrid-Barcelona line cutting their own emissions by 83% on the trip.

Not all has been perfect in Spain's high-speed world. In the Basque country the violent separatist group Eta has hijacked an environmental campaign against the train. Last year it shot Inazio Uria, a local contractor, because he had taken work on the line.

That, some say, was backhanded recognition of just how the train threatens to bring distant places such as the Basque country more tightly into Spain.