The warning from two influential French senators was stark, but it suggested there was still time to “save Yemen so that it does not become the next base for Al Qaeda.”

Diplomats in Qatar, Kuwait and Egypt used words such as “frightened” and said al-Qaeda was flourishing as Yemen faltered.

But the most dire assessments came from Saudi Arabia, where officials said Yemen would be a more hospitable environment for terrorists than even Afghanistan and was already so infested that it should be considered al-Qaeda’s “main home.”

In cold and unflinching language, dozens of previously secret U.S. diplomatic cables betray a level of international concern about the terrorist threat emanating from Yemen that is deeper and broader than has been publicly revealed.

The cables, from 2009 and 2010, depict a country on the verge of becoming a failed state even before the recent uprisings; a leader who exploited the threat of al-Qaeda to extract foreign counterterrorism help that he sometimes diverted for use against internal foes; and an al-Qaeda franchise remarkably suited to thriving in Yemen’s tribal culture and rugged terrain.

Mounting demonstrations against Yemeni President Ali Abdullah Saleh have heightened U.S. concerns about his country, disrupting counterterrorism operations involving U.S. Special Operations forces, aerial surveillance from armed Predator aircraft and clandestine CIA operations.

The cables, provided by the anti-secrecy Web site WikiLeaks, predate the Middle East uprisings by 10 or more months. Even so, they illuminate the stakes for the United States and its allies in a nation that, even when seemingly stable, served as a launchpad for attacks, including the attempted bombing of a Detroit-bound airliner in 2009.

The documents reveal a level of disagreement and dysfunction in U.S.-Yemeni counterterrorism efforts that helps explain why the campaign against al-Qaeda appears to have stalled after a series of early, high-profile strikes.

Finally, the cables raise new questions about the United States’ reliance on Saleh, an autocrat who is depicted as an often-uncommitted and unfocused partner in counterterrorism efforts long before protests threatened to end his 32-year-old reign.

The State Department declined to address the authenticity of the cables or their contents.

“The United States strongly condemns any illegal disclosure of classified information,” said Mike Hammer, the department’s acting chief spokesman. “In addition to damaging our diplomatic efforts, it puts individuals’ security at risk, threatens our national security and undermines our efforts to work with countries to solve shared problems.”

Diversion of resources

A cable issued by the U.S. Embassy in Sanaa, the Yemeni capital, last year noted that elite Yemeni counterterrorism units built with extensive American help to target al-Qaeda were instead being used by Saleh to subdue Houthi rebels in the country’s north.

The diversions included elements of Yemen’s special operations forces and one of its counterterrorism platoons. Both were sent “after Yemen’s regular forces struggled against the Houthis’ unconventional tactics,” said the cable, sent Jan. 13, 2010, by then-U.S. Ambassador Stephen A. Seche.

Saleh kept the counterterrorism team focused on the Houthi fight even after a Ni­ger­ian trained by al-Qaeda in Yemen allegedly attempted to detonate a bomb aboard a Detroit-bound flight.

Cables from capitals across the region lament Saleh’s apparent unwillingness to focus on the threat of al-Qaeda in the Arabian Peninsula (AQAP), as the Yemen-based off-shoot is known. Some leaders all but warned the United States that it was being hoodwinked.

Qatar’s prime minister urged the United States to support Saleh but to be skeptical of his assertions. “After 9/11 America liked to hear that nations were fighting against al-Qaeda,” Sheik Hamad bin Jasim al-Thani said, according to a cable from Doha. “But leaders should not fight their own wars and say they are fighting al-Qaeda.”

Sometimes Saleh himself slipped. Even when seeking to secure more money and weapons from U.S. visitors, Saleh struggled to convince them that he shared their commitment to the counterterrorism cause.

In a 2009 meeting with the deputy director of the CIA, Saleh ranked AQAP as a threat “on the same level” as separatists in the south and Houthi rebels in the north. Then, realizing his misstep, he quickly revised his rankings to put AQAP first.

“Saleh’s decision to reverse himself . . . was almost certainly taken with his U.S.G. interlocutors in mind,” a cable noted.

In recent weeks, there have been sporadic reports that Yemen’s counterterrorism teams have again been diverted, this time to police the capital and help suppress opposition groups that have mounted protests against Saleh.

U.S. officials said they have seen no evidence to confirm that assertion but acknowledge that American-Yemeni counterterrorism operations have all but ceased.

A Yemeni official briefed on security operations in the country said counterterrorism teams and special forces units have not been deployed against the protests. “Mainly they’ve been in their garrisons,” the official said.

The Obama administration had embraced Saleh and sought to encourage his cooperation with the promise of hundreds of millions of dollars in aid. But the administration appears to be stepping back now, and it has placed a hold on much of that money.

British-backed plans to open counterterrorism centers in provinces where AQAP is active also have been shelved by Saleh’s government, the Yemeni official said, because of “political turmoil.”

Even when Western-funded efforts to expand Yemen’s counterterrorism capabilities have moved forward, they have been hobbled by petty rivalries involving Saleh’s relatives.

A 2010 cable describes debilitating frictions between the country’s counterterrorism unit — in which a nephew of Saleh’s holds a top position — and special forces that carry out raids against AQAP and are commanded by the president’s son.

U.S. officials attended the unveiling of an intelligence-sharing center in Sanaa, where computers, digital mapping systems and communications gear were installed in place of an archaic setup that relied on “three old computers” and hard-copy maps.

But Saleh’s son was a “conspicuous” no-show at the ceremony and declared plans to establish a competing facility, according to the cable, which concluded that “the rivalry between Yemen’s two premier CT forces is far from over.”

Prospect of Saleh ouster

Despite such frustrations, U.S. officials have expressed concern that counterterrorism efforts might deteriorate if Saleh is driven from office. It is an apprehension that U.S. allies have long shared.

Saleh is “not the best leader,” said Saudi Arabia’s top counterterrorism official, Prince Nayef, according to a 2009 cable. But Saleh’s removal “would leave a vacuum that would further weaken Yemen.”

A splintered state would probably provide greater sanctuary for terrorists, according to U.S. counterterrorism officials. In recent months, they have begun describing AQAP as posing a more immediate threat to American interests than al-Qaeda’s core in Pakistan.

Whether a successor to Saleh would be as willing to allow CIA teams to operate inside the country and Predator aircraft to patrol overhead is a source of worry for U.S. leaders. A 2005 cable raised concerns about one possible contender, Brig. Gen. Ali Mohsen al-Ahmar, a powerful figure who recently threw his support behind the protest movement.

“Ali Mohsen’s questionable dealings with terrorists and extremists . . . would make his [ascension] unwelcome to the U.S.,” the cable said. “He is known to have Salafi leanings and to support a more radical Islamic political agenda than Saleh.”

The cables describe a steady flow of militant fighters into Yemen, suggesting that the center of gravity for al-Qaeda has been shifting away from Pakistan for some time.

Several hundred al-Qaeda-affiliated terrorists currently operate in Yemen and most of them come from abroad,” said a dispatch summarizing the concerns of French authorities last year. The cable also conveys a French request, naive-sounding in hindsight, to avoid calling public attention to the problem for fear of making it worse: “The media focus on the country risks increasing the country’s allure to terrorists, who may soon perceive Yemen as a particularly prestigious destination in which to base themselves.”