Naqeebullah Ibrahimkhel, a third secretary in the Afghan Embassy, was wounded when the men fired at him while he was returning from a market in Sector F-10 of Islamabad, Afghan Embassy spokesman Shams Zardasht said.
He was hit by a bullet in the leg. Ibrahimkhel, in-charge of education and student affairs at the Afghan Embassy, was taken to the Pakistan Institute of Medical Sciences for treatment.
Doctors described his condition as stable.
"We are not aware of the motives behind the incident and we demand that the Pakistani government should investigate it," Zardasht said.
Also Read
The spokesman further said unidentified gunmen had tried to kidnap Ibrahimkhel when he went to a market in Sector F-10 late on Wednesday.
Afghan Ambassador Umer Daudzai said: "We demand the government of Pakistan should ensure the security of all Afghan diplomats and embassy staffers to prevent such incidents in future."
Police officials claimed Ibrahimkhel was the victim of an attempted robbery.
Shalimar police station chief Sajjad Bukhari said the unidentified men fired at Ibrahimkhel when he resisted their attempt to rob him.