LONDON, (Reuters) -- A British soldier, accused of being an Iranian spy, took photos of former Prime Minister Tony Blair when he visited Afghanistan, a court heard on October 16.

Corporal Daniel James, who worked as interpreter for General David Richards, the British commander of NATO forces in Afghanistan, joined senior officers when Blair arrived at a Kabul base.

Sergeant Gareth Podesta, a member of the general's close protection team at the time, told the Old Bailey it was "strange" that James should be going to meet the visiting party, the Press Association reported.

"He was out on the football pitch which is where the helicopters land, taking photos," said Podesta, speaking by videolink from Afghanistan. "There was nobody else apart from the general and his close staff, and the protection team such as myself. It seemed strange why he was there."

The court has heard that James, 45, contacted Iranian officials in Kabul in 2006 to offer his services after becoming angry at being overlooked for promotion and at what he perceived was racial discrimination.

He is alleged to have sent coded messages to the Iranian military attache in the Afghan capital. He denies the charges.

Podesta told the court that James had said he did not like the former prime minister and thought Britain needed a new government. He also told the court that James had been told off about his lack of punctuality and tendency to wander off.

An Afghan translator who worked alongside James said the corporal had expressed sympathy with Iran when there were TV reports about its dispute with the United States over uranium production, the court heard in a statement.

Later an Afghan translator said James had expressed sympathy with Iran in its dispute with the United States over its nuclear ambitions. "He appeared to be supporting Iran," said the man, referred to only as N to protect his identity.

James denies three charges under the Official Secrets Act of communicating and collecting information likely to be useful to an enemy, and wilful misconduct in a public office.

The court heard that Tehran-born James, who became a British citizen in 1986 and had previously worked as a salsa dance teacher in Brighton, believed certain officers had been racist and had prevented him being promoted to sergeant.