An employee of the British embassy in Tehran went on trial yesterday, accused of being a spy in a move the foreign secretary David Miliband said "brings further discredit" to Iran's regime.

A tired-looking Hossein Rassam, chief political analyst at the embassy and an Iranian citizen, "confessed" in court that he had recruited a network of 50 agents on behalf of the embassy in the past year and attended pro-democracy demonstrations to gather information and foment unrest.

The dramatic appearance of Rassam came at the second mass trial of Iranians who had protested following the disputed June elections, which returned President Mahmoud Ahmadinejad by an unexpectedly high margin.

The British government says that Iran had given assurances that Rassam would not be tried. Rassam, 44, was one of nine locally employed British embassy employees arrested but was the only one to be charged – with damaging the country's national security.

Miliband last night said: "I am deeply concerned by the unjustified charges laid against Hossein Rassam in Tehran. Hossein is a member of our embassy staff going about his legitimate duties. Iranian action against him only brings further discredit on the Iranian regime."

According to the official IRNA news agency, Rassam confessed at the trial to handing over information about the protests to "Washington" and had apologised and asked for clemency. The semi-official Fars news agency said Rassam had admitted acting as liaison for senior British officials in the embassy, including Tom Burn, the second secretary, who was expelled, and had accompanied him to meetings with opposition leader Mir Hossein Mousavi. He had also confessed that the embassy had used "bursaries" and an English-language examinations scheme as a cover for contacts with members of the Iranian elites.

Last month, the release of Rassam on $100,000 bail was applauded by the foreign secretary who suggested strongly that the issue had been resolved.

Also appearing at yesterday's hearing was language teacher Clotilde Reiss, who had been arrested at Tehran airport on 1 July on charges of espionage. She was leaving the country after spending five months working as a teacher in Isfahan and had also been an employee of the French embassy. Miliband said European nations were united in their opposition to the trial. He said he was in close contact with members of the EU and had spoken to French foreign minister Bernard Kouchner and Swedish foreign minister Carl Bildt, the current EU president. "We have reaffirmed our solidarity in the face of this latest Iranian provocation," he added.

During the court session, a prosecutor read out an indictment outlining what he said were plans by the US and Britain to foment unrest in Iran with the aim of toppling the ruling Islamic system, the IRNA news agency reported. The vague indictment also accused the two powers of providing financial assistance to Iran's reformists to undermine hardline clerics within the ruling system.

Iranian defendants included Ali Tajernia, a former reformist lawmaker, Shahaboddin Tabatabaei, a prominent leader of the Islamic Iran Participation Front, Iran's largest reformist political party, and Ahmad Zeidabadi, an outspoken journalist opposing hardliners.

Iran's reformist and moderate parties have denounced the mass trial. The first session held last Saturday featured confessions that many human rights groups say were obtained under duress. One of the most high-profile defendants was a former vice-president, Mohammad Ali Abtahi, who served under former reformist President Mohammad Khatami.