The president of Afghanistan on Monday condemned the killings of David Gilkey, a veteran news photographer and video editor for National Public Radio, and Afghan journalist Zabihullah Tamanna in an insurgent ambush while on assignment.

Gilkey and Tamanna were traveling Sunday in the south with an Afghan army unit near Marjah in Helmand province when the convoy came under fire and their vehicle was struck, said network spokeswoman Isabel Lara in a statement. Two other NPR journalists, Tom Bowman and producer Monika Evstatieva, were traveling with them and were not hurt.

President Ashraf Ghani called the attack cowardly and "completely against all the principles and values of Islam and humanity, and against all international laws."

In a statement, Ghani said the Taliban do not distinguish among the military, civilians and journalists, and that they killed Gilkey and Tamanna as the two were reporting on the war. He offered condolences to their families.

Ghani went to Helmand later Monday to assess the security situation in the opium-poppy field region, which gives the world most of its heroin, controlled by the Taliban.

The U.S. Embassy in Kabul and U.S. Army Gen. John. W. Nicholson, commander of the U.S.-NATO Resolute Support mission in Afghanistan, also offered condolences.

"David and Zabihullah, in particular, spent years in Afghanistan tirelessly endeavoring to tell the story of the Afghan people," Nicholson said in a statement. "We have the utmost respect for their work as well as those others that endure the hardships that come with reporting from conflict zones."

U.S. Secretary of State John Kerry called the killings "a grim reminder of the danger that continues to face the Afghan people, the dedication of Afghan national defense and security forces to securing their country, and of the courage of intrepid journalists - and their interpreters - who are trying to convey that important story to the rest of the world."

Gilkey and Tamanna were killed along with two other people while riding in a vehicle that came under sustained Taliban attack about 300-400 meters (yards) from the main army base in Marjah, said Maj. Abdul Qader, deputy spokesman for the 215 Army Corp in Helmand province.

The Humvee, which was was hit by a rocket-propelled grenade, was carrying five people: Gilkey, Tamanna, a heavy machine gun operator who was on the roof, an Afghan army soldier and a driver, Qader told The Associated Press.

The driver and machine gunner were killed along with Gilkey and Tamanna in the attack, which lasted 30-40 minutes, he said, adding that army helicopters were called in to provide air support.

"The bodies were taken to the army base immediately after the attack, and then transported by helicopter to the corps command," Qader said. The bodies of Gilkey and Tamanna were taken to Camp Bastion, the main army base in Helmand, formerly under the command of U.S. Marines.

Gilkey, 50, had covered Iraq and Afghanistan since the Sept. 11, 2001, attacks on Washington and New York, and was committed to helping the public see the wars and the people caught up in them, NPR's senior vice president of news and editorial director, Michael Oreskes, said in a statement.

"As a man and as a photojournalist, David brought out the humanity of all those around him. He let us see the world and each other through his eyes," Oreskes said.

Tamanna, 37, was a freelance journalist who often worked as a translator for NPR, Lara, the spokeswoman, said in an email. Known as Zabi, he had years of experience as a reporter, cameraman and photographer for local and international news organizations in Afghanistan.

He worked in Kabul as a photographer for China's Xinhua news agency and also reported for Turkey's Anadolu News Agency. He is survived by his wife, two sons and a daughter.

The Afghan Journalists' Safety Committee described him as one of the country's most experienced journalists. He had a degree in law and political science from Kabul University. Aside from his work in daily news, he was a legal adviser to a local media consultancy.

Veteran correspondent Phillip Reeves, who recruited Tamanna to the network, called him "a great colleague."

"He was a lovely man, with a great eye for a story and deep wisdom about his country," Reeves said in a statement. "He clearly loved his family."

Gilkey covered both national and international news for the network and its website and had made numerous trips to Afghanistan and Iraq, according to NPR's website.

His work has been recognized with numerous awards, including the prestigious George Polk Award and a national Emmy. The White House News Photographers Association named Gilkey as Still Photographer of the Year in 2011. In 2015, he became the first multimedia journalist to receive the Edward R. Murrow Award for his coverage of international breaking news, military conflicts and natural disasters.

Twenty-seven journalists have been killed in Afghanistan since 1992, according to the Committee to Protect Journalists, not counting Gilkey and Tamanna. They include Anja Niedringhaus, a photographer for The Associated Press who was shot and killed in 2014 while covering the national elections for president and provincial councils. AP special correspondent for the region, Kathy Gannon, was wounded in the attack.

Worldwide, nearly 1,200 journalists have died since 1992, according to CPJ's website.

In addition to Iraq and Afghanistan, Gilkey covered the conflict between Israel and Hamas in Gaza, the devastating earthquake in Haiti in 2010, the fall of apartheid in South Africa, famine in Somalia, and wars in Rwanda and the Balkans.

"The things to do were amazing and the places to see were epic," Gilkey once said of his work. "But the people, the people are what made it all worth the effort."

Gilkey's first journalism job was with the Boulder Daily Camera in Colorado, where he covered local assignments for the paper and overseas assignments for Knight Ridder, according to NPR. He later joined the Detroit Free Press until moving to NPR in 2007.