Photojournalist Anja Niedringhaus was killled and her AP colleague Kathy Gannon wounded when an Afghan police officer opened fire on the car they were in.

KABUL, Afghanistan -- An Afghan police officer shot two Western journalists Friday, killing one and seriously wounding the other as they waited in a convoy of poll workers on the eve of the country’s closely watched presidential election.

The Associated Press said a veteran photographer, Anja Niedringhaus, 48, was killed instantly and that AP correspondent Kathy Gannon was wounded twice but was in stable condition.

The shooting occurred in Khost, a violent province along the border with Pakistan, where the journalists were due to accompany election workers who were delivering ballots to outlying areas. They were in their own car with a translator and driver, in a convoy guarded by Afghan soldiers and police, the AP said.

Officials in Khost said the shooter, who was in custody, is a police platoon commander named Naqibullah who was part of the security detail for the election convoy. As the convoy was waiting to depart from the district police headquarters in Tani, witnesses said Naqibullah walked up to the car, yelled “Allahu akbar” -- “God is great” -- and fired into the back seat with his AK-47 rifle, according to officials.

He then surrendered to other officers, AP said.

The Afghan Interior Ministry, which oversees the police, said it condemned the shooting “in the strongest terms.”

A spokesman for the provincial governor in Khost, Mubariz Zadran, said officials were investigating the officer’s motive. In the past, Taliban insurgents have infiltrated Afghan police and army units and staged deadly attacks, and Zadran said investigators were treating that as a possibility. But there was no immediate claim of responsibility for the shooting.

The Taliban have vowed to target anyone who participates in Saturday’s election, which it describes as a foreign plot, and in recent weeks militants have launched assaults on election offices in Kabul. But there has also been a steady escalation in attacks targeting Westerners and journalists.

Last month, a Swedish-British journalist, Nils Horner, was killed on a street in Kabul by unknown gunmen. Two weeks ago, an Afghan journalist working for the Agence France-Presse news agency was fatally shot along with his wife and two of his three children in a complex Taliban assault on the luxury Kabul Serena Hotel, which the Taliban said it targeted because it is popular with foreigners.

Niedringhaus, a German citizen, was a widely admired war photographer who covered conflicts in the former Yugoslavia, Iraq, Libya, the Palestinian territories and Pakistan. An AP staff photographer since 2002, she shared in the news agency’s 2005 Pulitzer Prize for breaking news photography from Iraq, and the same year received the Courage in Journalism Award from the International Women’s Media Foundation.

Gannon, 60, is a Canadian journalist based in Islamabad as AP’s special regional correspondent for Afghanistan and Pakistan. Both had traveled extensively in the region.

“Anja and Kathy together have spent years in Afghanistan covering the conflict and the people there. Anja was a vibrant, dynamic journalist well-loved for her insightful photographs, her warm heart and joy for life. We are heartbroken at her loss,” AP Executive Editor Kathleen Carroll said.

shashank.bengali@latimes.com

Twitter: @SBengali

Times special correspondent Hashmat Baktash contributed to this report.