As the battle in Libya appeared at stalemate, it was an open secret that foreign military advisers were working covertly inside the country providing guidance to rebels and giving tactical intelligence to NATO aircraft bombing government forces.
Diplomats say members of the alliance and partners in the Middle East were engaged in an undercover campaign on the ground in Libya. The operation was kept separate from the NATO command structure to avoid compromising its mandate from the United Nations _ to protect civilians.
These largely unseen supporters helped to transform the ragtag rebel army into the force that stormed Tripoli.
On Tuesday, French Foreign Minister Alain Juppe acknowledged the presence of the advisers, telling Europe-1 radio that France had contributed "a few instructors" to train rebel fighters.
With pockets of resistance remaining, NATO says the alliance's mission will continue despite the rapid rebel advance into Tripoli. Though the bloc has consistently denied that it had any troops in Libya, a spokesman did imply the presence of foreign forces, saying earlier this month that alliance planners "follow the situation through allied information sources that are in the area."
Analysts have noted that as time went on, the airstrikes became more and more precise and there was less and less collateral damage, indicating the presence of air controllers on the battlefields.
Targeted bombings launched methodical strikes on Libyan leader Moammar Gadhafi's crucial communications facilities and weapons caches. An increasing number of American hunter-killer drones provided round-the-clock surveillance as the rebels advanced.
Diplomats acknowledge that covert teams from France, Britain and some East European states provided critical assistance.
The assistance included logisticians, security advisers and forward air controllers for the rebel army, as well as intelligence operatives, damage assessment analysts and other experts, according to a diplomat based at NATO's headquarters in Brussels. The diplomat spoke on condition of anonymity due to the sensitivity of the issue.
The CIA and other U.S. intelligence agencies have been gathering information throughout the conflict from contacts they had developed when they were working with Gadhafi's government on counterterrorism against al-Qaida-related Islamic militant groups operating in Libya.
Another indication of foreign involvement was the rapid improvement in the rebel army's operations, especially better combat coordination not seen at the outset of the conflict.
"This is normally very difficult to achieve for untrained troops," said Barak Seener, a Middle East expert at the Royal United Services Institute, a British military think tank. "But they adapted quickly, which is indicative that special forces were training them. That goes without saying."
Foreign military advisers on the ground provided key real-time intelligence to the rebels, enabling them to maximize their limited firepower against the enemy. One U.S. official, speaking on condition of anonymity to discuss intelligence matters, said the Qatari military led the way, augmented later by French, Italian and British military advisers. This effort had a multiple purpose, not only assisting the rebels but monitoring their ranks and watching for any al-Qaida elements trying to infiltrate or influence the rebellion.
Bolstering the intelligence on the ground was an escalating surveillance and targeting campaign in the skies above. Armed U.S. Predator drones helped to clear a path for the rebels to advance.
The addition of U.S. drone aircraft into the Libyan theater was important to the rebels, in giving them access to constant surveillance of the terrain, said Gen. Jean-Paul Palomeros, the French Air Force chief of staff.
"The better the intel is, the more valuable it is," Palomeros told The Associated Press. "It's part of an ensemble: Time was also needed for the opposition forces to get organized."
In recent weeks, as the U.S. added more drones to the fight, they were able to do precision strikes closer to the cities, shadowing the rebels as they advanced through Zawiya and roared into Tripoli.
Over that time, Britain's National Security Council noted that cooperation had grown between NATO and the rebel groups, particularly in the coordination of airstrikes, according to one official familiar with the outcome of the meetings. After Britain and other nations send soldiers to Libya to provide training, it became apparent that rebel forces had improved their capabilities.
Combined with increasingly precise air strikes by allied forces, the rebels gradually wore down Gadhafi's forces, ruptured supply lines, and allowed more money and resources to flow to the opposition.
The allied bombings, coupled with the no-fly zone, the arms embargo and the Navy ships patrolling along the coast, all gave the rebels breathing room as they gathered arms and ammunition. Slowly, they were able to transform into a moderately effective fighting force.
Baldor reported from Washington. Associated Press writers David Stringer in London, Jamey Keaten in Paris and Kimberly Dozier in Washington contributed to this report.