British spies foiled Iran's attempt to get hold of nuclear weapons as recently as 2008, according to the head of MI6 Sir John Sawers.
However Sir John has warned that the Islamic republic is only "two years away" from obtaining nuclear weapons.
In rare public comments reported by the Daily Telegraph on Friday, the spy chief warned that it would be "very tough" for Britain or the US to accept a nuclear armed Iran.
“The Iranians are determinedly going down a path to master all aspects of nuclear weapons; all the technologies they need,” he said.
“It’s equally clear that Israel and the United States would face huge dangers if Iran were to become a nuclear weapon state.”
Speaking to Whitehall officials at the Civil Service Live event in West London, Sir John said that without the action of his spooks Iran would have achieved its nuclear ambitions in 2008 rather than being "two years away".
However Sir John Sawers comments appear to conflict with reports that US intelligence agencies concluded as recently as 2011 that Tehran halted efforts to develop and build a nuclear warhead in 2003.
The LA Times reported that an internal report for the Obama administration concluded that while Iran was pursuing technologies that would enable it to develop a nuclear weapon, it had not yet decided to actively build one.
While the Israeli Defence Force's (IDF) chief of staff, Lt. Gen. Benny Gantz, told Israeli newspaper Haaretz in April that while Iran was developing the ability to build a weapon he did not think it would take the final decision to do so.
"If the supreme religious leader Ayatollah Ali Khamenei wants, he will advance it to the acquisition of a nuclear bomb, but the decision must first be taken," he told the paper.
But added: "I believe he would be making an enormous mistake, and I don't think he will want to go the extra mile."
In May it was revealed that British ministers had discussed how the UK would respond to an Israeli strike against Iran's nuclear facilities.
According to the BBC the National Security Council has discussed what support would be given to Israel, from diplomatic backing or even assistance from the Royal Navy.
In June the former security minister and head of the Royal Navy, Lord West, said the likelihood of Israel launching an attack on Iran's nuclear facilities was increasing, and that he worried the US and subsequently Britain would be drawn into a wider conflict with Tehran.
Speaking to The Huffington Post, Lord West expressed concerns - privately held by many senior MPs - that Britain could easily find itself drawn into a conflict with Iran because of its naval assets in the Straits of Hormuz, through which around 40% of the world's oil leaves the Middle East.
"We are very tied to the Americans in terms of responses towards the Iranians, we have a lot of assets, commercial assets, in that region, which of course become vulnerable," he said.
"If for example, Israelis did attack, and the Americans decided they had to go in on it, I think it’s quite difficult to see us not getting involved."
Any British involvement could cause sever tensions with the coalition government between the Tories and the Lib Dems. The latter pledged to oppose military action in their 2010 election manifesto.
Sir Menzies Campbell, the former Lib Dem leader and foreign affairs spokesman, told the New Statesman in February that there should be a "presumption" against armed action.
"Military action would have the effect of setting fire to the Middle East," he said. "Anywhere you go in the United States or any senior policy figure that you speak to certainly believes that. The anxiety is about the possible actions of Israel. It's a damned close-run thing."
Abbas Edalat, spokesman for the Campaign Against Sanctions and Military Intervention in Iran (CASMI), said the "bellicose comments" from Sir John "contradict the consensus of US leaders and Israeli intelligence that Iran is neither developing nuclear weapons nor has decided to build them".
"Such theatrical hand-wringing by the British and American governments is a re-run of the hysteria whipped up against the non-existent WMDs by Iraq.
"Sir John Sawers has effectively confirmed what the Iranian government has long suspected: that the West has been waging a wholly illegal campaign of covert operations in Iran in its bid to destabilise the country in conjunction with its draconian and illegitimate sanctions and oil embargo in preparation for a war against Iran."