The Riyadh metro contract is one of three Saudi Arabia has granted to foreign consortiums, the kingdom announced at a news conference in the capital late on Sunday.
The combined value of the contracts is $22.5 billion (16.9 billion euros) and the consortiums are led by Spanish, US and Italian firms.
The 176-kilometre (110-mile) six-line network is aimed at easing chronic traffic congestion in Riyadh, a city of six million people.
Spanish-led BTP-FCC consortium will build three of the metro lines for $7.88 billion, after it beat competition from 38 groups that were vying for the project.
It is "the biggest international contract in the history of Spanish construction", the Spanish consortium said in a statement on Monday.
Alstom, part of the Spanish consortium, added that it was awarded a deal by Saudi Arabia to "provide a complete automatic and driverless metro system to equip three of the six lines."
Alstom's share of the deal will be more 1.2 billion euros, a statement said. "The project also includes also an option for 10 years of maintenance services."
The Riyadh metro, named the King Abdullah project for public transport in Riyadh, will take 56 months to build, according to Prince Khaled.
But other Spanish-led rail projects may still be affected by the horrific train crash in Spain that killed at least 79 people.
It comes at the worst time for the recession-hit nation's railway sector, which is pushing to win new markets for its high-speed trains.
Spain is in the running for a contract worth $16.4 billion (€12.7 billion) for a high-speed rail network in Brazil linking the cities of Rio de Janeiro, Sao Paulo and Campinas which will be awarded in September.
The country, which two years ago won a contract to build and operate a high-speed rail link in Saudi Arabia, is also eyeing new markets in the United States, Russia, Kazakhstan and the United Arab Emirates.
"Technologically Spain is a pioneer in high-speed rail," Alejandro Lago, a logistics professor at the Iese business school in Barcelona, told AFP.
Since the 1960s, the country has had trains made by its Talgo train maker that could circulate at speeds of up to 200kph (125mph), he added.
Spain has invested heavily in road and rail links over the past decade and it now has the second-largest high-speed train network in the world, spanning 3,100 kilometres. Only China's is larger.
But the July 24th crash — Spain's deadliest rail disaster in decades — is a huge blow for the country's bid for the deal in Brazil.
Brazil's bidding process for the country's lucrative infrastructure project specifies that firms in the run cannot have had an accident that caused deaths in their high-speed rail network in the last five years, El Pais reported.
That would appear to disqualify Renfe, according to the newspaper.
The rule — which applies only if an accident is due to "operational causes" — has already disqualified China's Communications Company Limited from the running due to an accident in June 2011 that killed 33 people.
The private and public Spanish companies that make up the consortium in the running for the contract have been reluctant to speak publicly about the impact of the accident on their bid.
But several unnamed sources close to the consortium, which includes Renfe and Spanish rail network administrator Adif, told Spanish business daily El Economista that they felt the contract was "lost".
This would be a major setback for Spain, which has been hoping to bank on its recent deal with Saudi Arabia to obtain similar projects.
"It's important because we're talking about high-speed rail and we want to show that we are world leaders in this area," Spanish secretary of state for transport, Rafael Catala, said in an interview with AFP earlier this month.
In 2011, a Spanish consortium won a €6.7-billion contract to build and operate a 450-kilometre (280-mile) high-speed rail link in the desert between the holy cities of Mecca and Medina.
Spain's first big foreign rail contract was signed with Turkey. A Spanish consortium built the high-speed rail link between Ankara and Istanbul which was inaugurated in 2009.
"During an economic downturn, the railway sector tries to compensate with activity abroad, with exports," said Pedro Fortea, the head of Spanish railway company association Mafex, which helps promote 73 firms abroad.
"Spain has experience which is transferable to other countries," he added.