The British "diplomat" captured in Libya along with seven special forces soldiers was a Bond-style MI6 spy, The Sun can reveal.

He and his SAS team were released last night, 72 hours after a secret mission to make contact with rebel leaders went badly wrong.

Angry questions were being asked about alleged intelligence failures that forced them to surrender when surrounded and "suicidally outnumbered" by militia.

Despite Government claims it sent a "small diplomatic team", The Sun can reveal it was an MI6 secret agent and his special forces minders.

The government has also confirmed that the botched SAS mission was authorised by Foreign Secretary William Hague.

Their job was to contact opponents of Libyan tyrant Colonel Gaddafi after intelligence reports that the rebels were open to talks.

But the Brits found themselves surrounded by scores of militia armed with AK-47 assault rifles and rocket-propelled grenades.

Armed farmers reportedly challenged the team when they arrived at an agricultural compound.

It was claimed they were spotted after driving into a farm and unloading kit bags.

One AK-47-wielding farmhand, named Rafah, said: "We fired into the air and said, 'Hands up, don't move'. They did as we said. It wasn't very difficult."

The farmers kept them at gunpoint for several hours, giving them breakfast while waiting until rebel leaders arrived.

Their phones and weapons were seized before delicate negotiations secured their release after 72 hours.

And last night a row was brewing over the bungled op - which handed a PR coup to Gaddafi.

The team was made up of the MI6 officer, six SAS troopers plus an Army signaller. They were captured on Friday near the town of Khandra, nearly 20 miles west of rebel-held Benghazi, after landing in the desert by helicopter three days earlier.

The MI6 man was NOT directly plotting to help bring down Gaddafi, Government sources insisted.

He was trying to establish diplomatic relations with rebels fighting to topple the dictator and a larger Foreign Office team was to follow.

It has emerged that rebel chiefs tried to persuade him to make London recognise them as the legitimate government.

Later Libyans were filmed holding underpants said to belong to one Brit - which they said had a secret compartment sewn into it.

After being freed, the team left Benghazi on the frigate HMS Cumberland, heading for Malta. A military source said they had to surrender. He went on: "This is a massive intelligence failure that rests on bad government planning. It is NOT a question of the professionalism or bravery of the SAS.

"They were suicidally outnumbered. The men did absolutely the right thing." The official slammed ministers "for yet another shambolic decision on Libya." He said: "This could have ended in catastrophe. Lives were at risk."

A senior member of Benghazi's revolutionary council said it had been feared the SAS men were Gaddafi's foreign mercenaries.

He said: "They were carrying espionage equipment, reconnaissance equipment, multiple passports and weapons. How do we know who they are?" Libyan state TV last night broadcast a recording of a phone call in which British Ambassador Richard Northern tells a rebel leader he was "not surprised" the SAS were greeted with hostility.

He says: "I understand there has been a misunderstanding and they have been picked up."

The rebel chief replies: "Actually they made a big mistake coming in with a helicopter in an open area." Mr Northern then says: "Oh did they? I didn't know how they were coming. I'm not surprised that's alarmed them."
British foreign secretary William Hague

A Foreign Office source said the team WAS given the green light to go in but local rebels were not told. The senior source said: "It's easy to criticise and the operation didn't go as well as hoped. But nothing ventured, nothing gained. It's vital to know what's going on in Libya." The SAS men were from a unit formerly known as The Increment, hand-picked to protect MI5 and MI6 officials.

It was the latest British embarrassment over Libya, after the US shot down the idea of a no-fly zone and we were slow off the mark rescuing stranded citizens.

And Gaddafi exploited it last night, telling his citizens the uprising was a Western conspiracy.

Mr Hague said further attempts will be made to contact the rebels.

He said: "A small British diplomatic team has been in Benghazi. They experienced difficulties, which have been resolved."