Canada is recalling its ambassador to Iran after Tehran abruptly ended the trial of an intelligence agent accused of killing a Canadian journalist.
Ambassador MacKinnon was barred from Sunday's court hearing
Foreign Minister Bill Graham said Ambassador Philip MacKinnon would return to Canada after what he called a "flagrant denial of justice".
Mr MacKinnon was at Saturday's hearing but was barred from the second day.
Lawyers for slain Iranian-born Zahra Kazemi said the trial was a farce and refused to sign the court record.
Ms Kazemi died of a brain haemorrhage in 2003 after she was held for taking pictures outside a prison. Mohammad Reza Aghdam Ahmadi, accused of killing her, has pleaded not guilty.
No date has been set for the verdict.
Canada had earlier suspended the recall of its ambassador, but decided to go ahead with the move after all on Sunday.
Ms Kazemi's defence team - led by Nobel Peace Prize winner Shirin Ebadi - has accused the Iranian authorities of a cover-up, saying a more senior official is the real culprit.
Ms Ebadi told a news conference after Sunday's court session that if the Iranian legal system could not provide justice, "there are international organisations" that could do it.
"They didn't even pay attention to our evidence and announced the end of the trial," Ms Ebadi told reporters outside the Tehran court.
"This is not a fair trial. The case hasn't been reviewed. If they issue a verdict it will be unfair," she said.
Refusing to sign documents which legitimise the court, she then called for the case to be moved to a higher provincial tribunal.
The trial has strained Iran's relations with Canada and deepened the rift between Iran's reformist government and the hardline judiciary, correspondents say.
Reformist President Mohammad Khatami has said he believes the intelligence agent is innocent and has called on the judiciary to identify "the real guilty person".
Ambassador Philip MacKinnon of Canada, his Dutch counterpart representing the European Union and senior diplomats from Britain and France - alongside foreign journalists - arrived at the courtroom to find their access blocked.
The guards at the gate explained that, unlike a day earlier when they were allowed in, the rules had now changed and no foreigners would be admitted.
A spokeswoman for the UK Foreign Office confirmed that a British observer had attended the trial on Saturday but was denied entry on Sunday. She made no further comment.
According to Iranian journalists allowed into the courtroom, the judge said they were being barred to show the international community that Iran would not bow under pressure.
"Zahra Kazemi was an Iranian citizen. It is absurd for Canada to claim she was Canadian... It does not make sense to have a Canadian representative there," Iran's foreign ministry spokesman Hamid Reza Asefi told reporters.
"Any such presence would not in any way add to the fairness or impartiality of any trial," he said.
The diplomats sharply criticised their exclusion from the trial and warned there would be serious consequences.
"The cause of human rights in Iran has taken a very serious blow today," one told reporters.
More senior culprit?
Ms Kazemi, 54, was detained on 23 June 2003, after taking pictures outside Tehran's Evin jail.
She died in hospital in Tehran on 10 July after falling into a coma, having received head injuries during more than three days of interrogation.
Defendant Mohammad Reza Aghdam Ahmadi denied the charge of "semi-intentional murder" at the trial's opening session last October.
Proceedings resumed on Saturday after a nine-month break, intended to allow lawyers representing the Kazemi family to research the case.
The lawyers told the court that witnesses had seen her being hit on the head by a senior judicial official, identified as Mohammad Bakhshi.