Eight British servicemen who were detained after their boats strayed into Iranian territorial waters have been turned over to British diplomats and were taken to the embassy in Tehran under tight security, officials said Thursday.

Protesters angry about the occupation of Iraq tried to approach the six Royal Marines and two sailors as they arrived at Tehran's airport accompanied by British consular officers, but they were kept away by police.

The eight were detained Monday after their boats apparently strayed into the Iranian side of the Shatt-al-Arab waterway (search), or Arvand River, that runs along the Iran-Iraq border while delivering a patrol boat to Iraq's new river police.

"I'm told that they are in very good spirits and were well cared for," British Foreign Secretary Jack Straw (search) said in a brief statement.

On hearing the news, Paula Harkins, wife of Royal Marine Sgt. Thomas Harkins, said: "I'm ecstatic." Harkins was shown on Iranian state television Tuesday apologizing for entering Iranian waters.

Iranian Foreign Minister Kamal Kharrazi said Iran also will release the three British boats and the troops' equipment, state TV reported.

"We will hand over the boats and the equipment the British troops were carrying within the next five days," it quoted Kharrazi as saying. Previous reports said Iran would keep the boats, firearms and equipment.

Iran also briefly detained, investigated and then released an unspecified number of Turkish troops who strayed across the border "by mistake," state TV reported.

It gave no timing for the detention or release of the troops, but unconfirmed reports said Wednesday that 25 Turkish soldiers chasing Kurdish rebels crossed into Iran and were detained by Iranian forces.

A number of protesters waited at the Tehran airport for the arrival of the British servicemen and demanded they stand trial for entering Iran illegally, state TV said. Hard-line Iranians opposed to Britain's prominent role in the occupation of Iraq have in recent weeks held angry demonstrations outside the British Embassy.

Strains between the two nations rose last week when Britain helped draft an International Atomic Energy Agency (search) resolution rebuking Iran for past nuclear cover-ups.

The servicemen's capture had further fueled tensions between the two countries, but Straw said he remained convinced that Britain's policy of engaging with Iran was wise.

"We have diplomatic relations with Iran, we work hard on those relationships and sometimes the relationships are complicated but I'm in no doubt at all that our policy of engagement with the government of Iran ... is the best approach," he said.

He praised the efforts of his Iranian counterpart, Kamal Kharrazi.

Iran had initially said it would prosecute the British servicemen for illegally entering Iranian waters. Concern in Britain ran high after Al-Alam television showed the sailors blindfolded and sitting cross-legged on the ground.

But telephone conversations between Straw and Kharrazi and constant dialogue between British and Iranian officials appeared to ease the situation, and Iran softened its position, saying the servicemen would be freed if interrogations proved they had "no bad intention."

Two of the detained men appeared on Iranian television Tuesday night apologizing for mistakenly entering Iranian waters.

The Ministry of Defense said the personnel were from the Royal Navy training team based in southern Iraq and were delivering a boat from Umm Qasr to Basra, Iraq, when they were captured.

The waterway has long been a source of tension between Iran and Iraq. The 1980-88 Iran-Iraq war broke out after Saddam Hussein claimed the entire waterway.