Image caption The BBC said Ahmad Shah was a respected and popular journalist

A BBC reporter has been killed in the east Afghan province of Khost, on a day of attacks which left nearly 40 people dead, other journalists among them.

Ahmad Shah, 29, had worked for the BBC Afghan service for more than a year.

In a statement, BBC World Service Director Jamie Angus said Shah had been a "respected and popular" journalist.

"This is a devastating loss and I send my sincere condolences to Ahmad Shah's friends and family and the whole BBC News Afghan team," he said.

"We are doing all we can to support his family at this very difficult time."

Khost police chief Abdul Hanan told BBC Afghan that Shah had been shot by unidentified armed men. He said police were investigating the motive.

Locals told the BBC that Shah had been on his bicycle when the attack happened. He was then taken to hospital, where he died of his injuries.

He was in a normally safe area he was familiar with when the attack happened, the BBC's News and Current Affairs Director Fran Unsworth said.

Last year, Afghanistan was ranked the third most dangerous country in the world for journalists by Reporters without Borders. It said nine journalists had been killed in three separate attacks.

Shah is the fifth BBC staff member to have been killed in Afghanistan since the country's devastating civil war in the 1990s. The others are:

Mirwais Jalil , 25, who was attacked by four gunmen in 1994

, 25, who was attacked by four gunmen in 1994 Abdul Samad Rohani who was shot dead in Helmand Province in 2008

who was shot dead in Helmand Province in 2008 Ahmed Omed Khpulwak , 25, who was mistakenly killed by Nato-led forces in 2011

, 25, who was mistakenly killed by Nato-led forces in 2011 Mohammed Nazir, a BBC driver who was killed in a bomb attack in 2017

Khost, where the attack happened, borders Pakistan and was an important theatre in the conflict with militants after US-led forces invaded Afghanistan in 2001.

The Taliban still has a presence in parts of the province but attacks are rare now.

Elsewhere in Afghanistan, 26 people were killed in two bombings in the capital, Kabul.

Nine journalists and photographers, and four police officers, were among those killed, officials say. Some 45 people were reported injured in the attacks.

Media playback is unsupported on your device Media caption The second explosion targeted those at the scene of the first

The first explosion was carried out by an attacker on a motorbike. A second followed about 15 minutes later after a crowd, including several reporters, had gathered at the scene.

The AFP news agency said the second blast had deliberately targeted the group of journalists, including its photographer Shah Marai.

The Islamic State group (IS) said it had carried out the attack. The intelligence services headquarters had been the target, IS said in a statement released through its self-styled news outlet Amaq.

The Shashdarak district also houses the Defence Ministry and a Nato compound.

And in a third attack, 11 children were killed in a suicide bombing intended to target Nato troops in Kandahar province.