KANDAHAR - Gunmen wearing Afghan military uniforms shot dead two NATO soldiers on a base in the country's south on Saturday, the coalition said, in the latest insider attack on foreign troops.

The Taliban did not immediately claim responsibility for the attack, but it comes after the insurgents last month announced the start of their annual spring offensive, vowing "large-scale attacks" across Afghanistan.

"Two Resolute Support (NATO) service members died this morning when two individuals wearing Afghan (security) uniforms opened fire... in southern Afghanistan," the coalition said. "Resolute Support members returned fire and killed the shooters."

NATO did not disclose the nationalities of the victim or the location of the attack, saying it was jointly investigating the incident with Afghan forces. Afghan authorities said the incident took place in a military base in Kandahar, adding that two people were also left wounded in the incident.

So-called "green-on-blue" attacks - when Afghan soldiers or police turn their guns on international troops - have been a major problem during NATO's long years fighting alongside Afghan forces.

In a similar attack in August last year, a man wearing an Afghan military uniform shot dead two American soldiers in the southern opium-rich province of Helmand. And in April last year an American soldier was killed in a firefight between US and Afghan troops in eastern Afghanistan.

Western officials say that most such attacks stem from personal grudges and cultural misunderstandings rather than insurgent plots.

The killings have bred fierce mistrust between local and foreign forces even as the rate of such incidents has dropped in recent years. NATO troops have adopted special security measures in recent years to try to counter the threat.

NATO ended its combat mission in Afghanistan in December 2014, pulling out a bulk of its troops although a 13,000-strong residual force remains for training and counter-terrorism operations.

The Afghan military, which has been built from scratch since the fall of the Taliban regime in 2001, has also struggled with insider attacks, high casualty rates and mass desertions.

Afghan President Ashraf Ghani recently threatened diplomatic reprisals against Pakistan if it refuses to take action against insurgent havens on its soil.

His unusually strong remarks were in response to a Taliban assault on a security services office in the heart of Kabul, which left 64 people dead in what appeared to be the deadliest attack on the Afghan capital since 2001.

The carnage on April 19 cast a pall over international efforts in recent months to jumpstart Pakistan-brokered peace talks, which stalled last summer after the Taliban belatedly confirmed the death of longtime leader Mullah Omar.