By Josh Smith and Mirwais Harooni

SALANG PASS, Afghanistan (Reuters) - Afghanistan's campaign to clear millions of landmines left by the Soviet invasion and ensuing civil war is in danger of stalling, as international aid slumps and militant violence makes more of the country inaccessible.

The mammoth task, vital to the country's economic recovery, was to have been completed by 2013, and nearly four fifths of the country is now considered mine free.

But slowing progress means the deadline set by the international community was pushed back 10 years, and even that looks a tall order in a country that remains one of the most heavily mined in the world.

"The longer these minefields last, the higher the human cost," said Mohammad Shafiq Yosufi, chief of the Afghan government's Directorate of Mine Action Coordination.

"They kill and maim people, prevent economic growth, investment, and tourism, hurt livelihoods and cause psychological fear that cannot end until they are gone."

Nearly 600 square km of old minefields and battlefields remain to be cleared, encompassing more than 3,000 known sites and affecting 1,570 communities, according to the United Nations.

One such area lies near the Salang Pass, some 80 km (50 miles) north of Kabul, where earlier this month mine clearers dressed in bulky blue kevlar armor and protective face masks lumbered slowly across fields waving metal detectors before them.

When they hear a warning beep, they painstakingly scrape layers of soil and rock away by hand until the metal object is revealed. Sometimes it is an old drinks can. Here it is more likely to be a rusty mortar shell or old Soviet land mine.

"I choose this profession to serve my country and feed my family," said Abdul Wakil, a deminer working for a company contracted by the government.

Standing on a hill where any step could be his last, Wakil shrugs off the risk.

"There are dangers, but we have to cope with it to provide a better environment for our people."

RISKS RISING AGAIN

Recently the crew made a potentially deadly find: a 30-year-old landmine connected by trip wire to a grenade.

From April to June, at least 28 people were killed and 53 wounded by landmines and other unexploded ordnance in Afghanistan, according to the government.

That is sharply down from the average of 507 casualties per quarter recorded in 2001, when the Taliban regime was toppled by a U.S.-led military operation. But it is an increase over the same period last year, when 38 civilians were killed or injured.

Nearly 80 percent of casualties from landmines and other explosives this year were children, the United Nations said.

"It is like one war on top of another," said Abdul Qadir Halimi, a liaison between the Afghan government and demining organizations, as he dropped a shattered hunk of metal back into a pile of grenades, mortar shells, and bullets that testify to ferocious battles that haunt these hills.

Demining has always been a dangerous job, but increasing insurgent violence around the country has meant clearance operations are limited to fewer areas, and deminers face more risks.

In the first six months of 2016, they faced 25 security incidents, with six people killed and nine wounded. Another 67 were kidnapped and eventually released. In 2015, 35 incidents were recorded, with eight killed, 34 wounded and 63 kidnapped.

"Security is an increasing problem," Yosufi said.

Officials said there were recorded minefields or other hazardous areas in at least 26 of Afghanistan's 34 provinces that are now too dangerous for clearance operations.

In some cases, insurgents or criminals have targeted deminers. In others, Taliban fighters have respected them.

Ghulam Dastigir, a team leader, said his demining identification card may have saved him when militants pulled him and other passengers off a bus.

WHERE IS THE MONEY?

International funding earmarked for demining in 2016 is $22 million (£16.7 million), a fraction of the $85 million United Nations officials say is needed.

Donations have plunged since 2011, when donors provided $97 million for demining. At the same time, yearly funding needs have increased, partly due to more minefields being discovered and partly because of the shortfall in past years.

Last year $38 million was provided for demining, out of $65.9 million required.

Afghan and U.N. officials fear that this year's total may not be enough, as international attention and spending shifts to other conflicts like those in Syria and Iraq.

"If these concerns continue, there is a risk we won't be able to attain our goal of clearing the country by 2023," Yosufi said.

The United States, the largest contributor to demining programs, said it was committed to maintaining support of around $20 million per year, but that work was needed to encourage others to do the same.

"The United States has actively worked in diplomatic channels to re-energize other international donor nations to keep this effort moving forward," said David McKeeby, a spokesman for the U.S. Department of State's Bureau of Political-Military Affairs.

Representatives of some previous donor nations that have reduced or ended funding for demining in Afghanistan did not respond to requests for comment.

McKeeby added: "The United States, together with our many international partners, has helped Afghanistan make significant progress. Despite this progress, much work remains before Afghanistan reaches its goal of becoming mine free by 2023."

(Reporting by Mike Collett-White)