The attack in Nangarhar province targeted Japanese doctor Tetsu Nakamura as he was heading to the provincial capital, Jalalabad, according to the provincial governor's spokesman, Attaullah Khogyani.
Nakamura was seriously wounded and was reported to be in critical condition immediately after the attack. He underwent surgery at a local hospital but died of his wounds shortly after, while being airlifted to the Bagram airfield hospital in the capital, Kabul, said Gulzada Sanger, the hospital spokesman.
Nakamura had headed the Japanese charity, Peace Medical Service, in Nangarhar since 2008. He came to Afghanistan after a Japanese colleague, Kazuya Ito, was abducted and killed.
In April, Afghan President Ashraf Ghani granted Nakamura honorary citizenship of Afghanistan.
Ghani's spokesman, Sediq Sediqqi, condemned the attack that killed Nakamura, calling it a "heinous act and a cowardly attack on one of Afghanistan's greatest friends."
"Dr. Nakmora dedicated all his life to change the lives of Afghans, worked on water management, dams and improvement of traditional agriculture in Afghanistan," Sediqqi added.
No one immediately claimed responsibility for the attack, the second in as many weeks targeting aid workers in Afghanistan.
The Nangarhar governor, Shah Mahmood Meyakhail, expressed his condolences, saying that the people of the province were all saddened over Nakamura's death and remain thankful for the services the Japanese physician provided for them for over a decade.
Hundreds of Afghans posted photographs of Nakamura on their social media pages, condemning the killing and underscoring how respected the Japanese physician was.
The Taliban, who along with the Islamic State group, operate across the province, denied involvement in the attack. Their spokesman Zabihullah Mujahid tweeted that the insurgent group "has no connection" to Wednesday's shooting and does not consider the Japanese charity a target in the holy war the Taliban are waging to create an Islamic emirate.
Nangarhar police said they were searching for the attackers, who fled the scene, and that an investigation was underway.
In late November, an American working for the United Nations mission in Afghanistan was killed and five Afghans, including two staff members of the mission, were wounded when a grenade hit a U.N. vehicle in Kabul.
On Monday, a gunman opened fire on a vehicle in Kabul, killing two intelligence officials and wounding three others. No one claimed responsibility for that attack, but both the Taliban and the IS affiliate have been behind such attacks.
The Taliban control or hold sway over nearly half of Afghanistan, staging near-daily attacks that target Afghan forces and government officials but also kill scores of civilians.