Security in Iraq has collapsed so dramatically that Saudi Arabia has ordered the construction of a 550-mile high-tech fence to seal off its troubled northern neighbour.
The huge project to build the barrier, which will be equipped with ultraviolet night-vision cameras, buried sensor cables and thousands of miles of barbed wire, will snake across the vast and remote desert frontier between the countries.
The fence will be built despite the hundreds of millions of pounds that the Saudi kingdom has spent in the past two years to beef up patrols on its border with Iraq, with officials saying the crisis in Iraq is now so dangerous it must be physically shut out.
"Surveillance has already been stepped up over the past 18 months," said Nawaf Obaid, the director of the Saudi National Security Assessment Project, an institute that advises the government on security affairs.
"But the feeling in Saudi is that Iraq is way out of control with no possibility of stability. The urgency now is to get that border sealed: physically sealed."
The fence is a fresh sign that key allies of the United States in the Middle East are resigned to worsening violence and the possible break-up of Iraq, where American intelligence agencies said this week that the continuing conflict fuelled global terrorism. The National Intelligence Estimate, a report compiled by 16 spy agencies, concluded that the Iraq war had become a cause célèbre for Islamic extremists and was cultivating supporters for the global jihadist movement
For Saudi Arabia, whose nationals have been accused of playing a key role as foreign fighters in the Iraq insurgency, the deterioration in its northern neighbour is a security nightmare.
Saudi officials are worried about so-called "blowback", in which Saudi insurgents in Iraq bring jihad back to the streets of Riyadh and Jeddah. But they are mostly concerned that an Iraqi civil war will send a wave of refugees south, unsettling the kingdom's Shia minority in its oil-producing east.
"If and when Iraq fragments there's going to be a lot of people heading south and that is when we have to be prepared," said Mr Obaid.
For many years Saudi plans to improve security on the Iraqi border have been part of a vast multi-billion-pound air, sea and land-based project to protect the whole country, known as Miksa, or Ministry of Interior Kingdom of Saudi Arabia. The scheme aims to ring the country with hundreds of radar facilities, coastal sonar detection bases, a telecommunications network and patrols by reconnaissance aircraft.
But the huge centralised project, which one defence contractor who works closely with the Saudi government valued at up to £13 billion, has been slow to get off the ground. Now the kingdom has decided that it cannot afford to wait for Miksa to stave off the threat of violence spilling over from Iraq. Contractors competing for the project will have to promise that they can complete the whole 550 miles of fence within a year.
"Everyone you speak to in Saudi Arabia says it is now desperately urgent," said Anthony Forester-Bennett, from Westminster International, a British company bidding to help build the fence. "They say there's a real danger of very nasty people coming across from Iraq."
Analysts said that even taking into account delays and disputes that usually accompany such valuable military contracts, the fence was on course to be finished by the early summer of 2008. The total cost is expected to reach at least £300 million,
Once complete it will revolutionise border security, where currently the best weapons in the fight against terrorists are 100 sniffer-dog teams who patrol the frontier.
Outwardly it will appear mundane, with two metal barriers running 100 yards apart, lined with barbed wire at the base and top. On the Iraqi side, alarms will notify patrols if an intruder attempts to scale or cut through the fence. Between the two fences will be yet more barbed wire, piled in a tall pyramid.
But its effectiveness will rely on its more sophisticated or hidden counter-measures. Under the baking sand will be buried sensor cables relaying a silent alarm to monitoring posts at regular intervals along the border. At the posts, face-recognition software will process pictures relayed from cameras, which will also be able to operate at night.
"The costs are not going to be about just building the fence but equipping it too," said Mr Obaid. Behind the line of the fence, command and control centres with heliports would provide bases for troops to respond to any alert.
For Saudi Arabia, terrorists and refugees from the conflict are not the only unwelcome intruders.
"We suffer badly from illegal immigration, as well as the smuggling of drugs, weapons and even prostitutes," said Mr Obaid. "It is becoming a major issue."
Despite the details emerging about the fence, Saudi Arabia's military is keeping some aspects under wraps. According to one source, the project is being kept so secret that military officials from Centcom, America's central command responsible for Iraq, have been told they cannot inspect the site on "national security" grounds.
Even spy satellites will not be able to unravel the fence's secrets. The source speculated that the reason for the secrecy might be automated weapons systems attached to the fence that could fire on suspected smugglers or intruders.
"It's being done in true Saudi style," the source said. "State-of-the-art equipment and no expense spared."
Information appearing on telegraph.co.uk is the copyright of Telegraph Group Limited and must not be reproduced in any medium without licence. For the full copyright statement see Copyright