A police spokesman in the Khost province said Niedringhaus had been killed and Canadian journalist Kathy Gannon seriously injured in the shooting.
Gannon was taken to hospital but Niedringhaus died instantly, the spokesman said. He confirmed that the attack was carried out by an Afghan policeman who reportedly shouted "Allahu Akbar" before opening fire.
Niedringhaus was in the country to cover the elections with voting starting on Saturday.
Both women were working for the Associated Press (AP) news agency, which confirmed the incident. It said in a statement that one of its freelancer television journalists witnessed the shooting.
They were, AP said, both sat in a car as part of a convoy delivering election ballots to Khost city. A unit commander came over when the vehicle was stationary and opened fire through a car window with his AK-47. He has been arrested.
Niedringhaus was part of an AP team which won a Pulitzer Prize in 2005 for photography of the Iraq War.
"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," said AP Executive Editor Kathleen Carroll.
The 48-year-old started her career as a freelance photographer for a local newspaper in her hometown of Höxter, North Rhine-Westphalia, at the age of 16.
After finishing high school, she went on to study German literature, philosophy, and journalism in Göttingen, according to her website.
She went on to work for the European Pressphoto Agency (EPA) as a chief photographer until 2001 where she covered the conflict in the former Yugoslavia. She was also based for several years in Sarajevo and in Moscow.
On her first day in Sarajevo, Niedringhaus was hit by a sniper’s bullet.