The Afghan court found the man guilty of both murder and abuse of office and sentenced him to the death penalty, according to a court statement released on Wednesday.
The uniformed commander shot the 48-year-old prizewinning photographer in Afghanistan's unstable south-western province of Khost on April 4th while she was sitting in a car.
His motive is still unclear, although investigators believe the attack was planned in advance as he shouted "Allahu Akbar" before opening fire.
Niedringhaus, whose colleague the Canadian journalist Kathy Gannon was also badly injured in the attack on their vehicle, had been covering Afghan Presidential elections for the Associated Press news agency.
PHOTO GALLERY: Anja Niedringhaus' war photography
They were, the AP said, both sat in a car as part of a convoy delivering election ballots to Khost city.
The unit commander came over when the vehicle was stationary and opened fire through a car window with his AK-47.
Gannon was taken to hospital but Niedringhaus died instantly.
The convicted man has 15 days to appeal the death sentence, said the vice governor of Khost province. Judicial executions must be approved in writing by the Afghan president, he added.