MAZAR-I-SHARIF, Afghanistan — Two American soldiers from the NATO alliance were shot dead on Monday by an Afghan border policeman in the north of the country, military officials said.

NATO confirmed the deaths, the latest attack on international soldiers, and said it was investigating the incident which occurred inside a police compound while US military advisers were holding talks with a local colonel.

"According to initial reporting, an individual in an Afghan border police uniform fired on the ISAF members inside a compound," NATO said in a statement.

"The individual who fired the shots fled the scene," it added, without giving further details.

However, an Afghan border police colonel named Najmuddin, who like many Afghans uses only one name, confirmed the attacker was a border policeman and said the victims were Americans.

"I was meeting with some American advisers who had come to my office. We were setting inside talking. Two of their soldiers were outside the office guarding along with one of our personal," Najmuddin told AFP.

"We heard gunshots. When we came out we saw that our guy had shot the two American soldiers dead and himself had escaped. We are investigating this," he said.

Gen Habibullah Sayedkhaily, the commander of the border police brigade in Faryab confirmed the incident and said he was investigating how it happened.

On a string of previous occasions, members or purported members of the Afghan security forces have killed their foreign counterparts.

In November last year an Afghan border policeman killed six American soldiers who were training local police officers.

There are nearly 140,000 international troops, mostly NATO forces deployed under US command, in Afghanistan tasked to defeat a Taliban-led insurgency.