TARIFA, Spain - Engineers have dreamt of it for a quarter-century: linking Europe and Africa at the spot where the two very different worlds gaze at each other across a strip of choppy water.

Now, after seemingly endless studies that turned up more than one nasty geological surprise, a project for a high-speed rail tunnel connecting the continents is gathering momentum, raising the prospect of an engineering marvel on par with the Panama Canal or the Channel Tunnel between Britain and France.

This tube for passengers, cars and freight would bore deep under the Strait of Gibraltar, the narrow waterway where the Atlantic flows into the Mediterranean, and run from Tangier, Morocco, to the Spanish town of Tarifa at Europe's southernmost tip, possibly extending further both ways in the future. European engineering consultants brought in a few months ago are to complete a feasibility study this year.

"I think this project is a utopia that is becoming a reality," said Angel Aparicio, president of the Spanish government agency overseeing the endeavor with Moroccan partners.

Aside from fueling economies on both sides of the strait, planners are excited by the symbolically powerful feat of bridging two continents as far apart socially and culturally as they are close geographically.

But the technological challenges are mammoth: A test tunnel dug outside Tarifa a decade ago, for instance, unearthed a smorgasbord of soils, some on the mushy side, hardly the right stuff for anchoring such a grand structure.

The cost is unofficially projected to run more than $13 billion, and engineers say the tunnel would take about 20 years to construct. Spain and Morocco hope to receive European Union financing if the project gets under way.

There's also the issue of whether that economic chasm between Europe and Africa would doom the tunnel as a white elephant. Planners wonder whether Africa is too poor to provide a sustained, profitable flow of people and goods on the northbound leg of a tunnel.

Even the popular Channel Tunnel, which opened in 1994, has accrued $16 billion in debt, and the company operating it, Eurotunnel, received bankruptcy protection from creditors last year. The costs of digging the 30-mile undersea rail tunnel were massively underestimated, and traffic predictions proved optimistic.

Still, Spanish Prime Minister Jose Luis Rodriguez Zapatero said last month that he was fully committed to the Strait of Gibraltar project. He said the tunnel would "greatly speed growth, development and prosperity" on both sides of the Mediterranean.

Planners hope the tunnel will create "an integrated Euro-Mediterranean economic area" and be more than just a way to cross the strait, a journey now done by ferry.

They envision a day when tracks from the tunnel would stretch as far south in Morocco as Marrakech and allow for travel time just a fraction of what it is now.

Morocco's tourism industry, which the government has marked as a key economic motor for the future, would benefit from a tunnel.

"Tourist flows will accelerate because people will be able to come with their own transport. For now, the need to cross by boat presents a psychological and practical barrier," said Tajeddine el-Husseini, professor of international economic law at Mohamed V University in Rabat.

The biggest winners in Morocco would probably be exporters, who could ship their goods, mainly agricultural products, north more easily. Being able to send them to Europe by train rather than ship would also make for easier export of such fragile products as tomatoes and flowers.