An Afghan border policeman has been killed and two Pakistani soldiers wounded in an exchange of fire along the border, officials from both countries have said.

A senior Afghan official said hundreds of additional Afghan troops had been sent to a disputed border gate after the exchange of fire late on Wednesday, which lasted for more than two hours.

A Pakistani military source said the shooting was triggered by an attack on a Pakistani checkpost.

"It was continuous fire on one of our checkposts that forced our troops to retaliate," the official told the AFP news agency.

"[The] Afghan National Army was firing with small and heavy weapons. At least two of our security personnel were injured. We will raise this issue on the proper forum."

The senior Afghan official said trouble started after Pakistani troops attempted to fortify the border gate.

An administrative official in the Mohmand district along the Afghan border confirmed the exchange of fire and told AFP that five ambulances had been sent to the area.

Trading blame

The exchange is the latest incident in a series of cross-border attacks, which Afghan and Pakistan authorities have traded blame for initiating.

Afghanistan has grown increasingly frustrated with Pakistan over efforts to pursue an Afghan peace process involving the Taliban, suggesting that Islamabad is intent on keeping Afghanistan unstable until most foreign combat forces leave at the end of 2014.

Afghan officials say Pakistan has a long history of supporting Afghanistan's Taliban and other armed groups.

Pakistan has in turn accused Afghanistan of giving safe haven to fighters on the Afghan side of the border.

The latest tensions are focused on Pakistan's building of a military gate which Afghan officials say is inside Afghanistan.

Afghan President Hamid Karzai has ordered his top officials to take immediate action to remove the gate and other "Pakistani military installations near the Durand Line".

Disputed Durand line

The Durand Line is the 1893 British-mandated border between the two countries. It is recognised by Pakistan, but not by Afghanistan.

Afghanistan maintains that activity by either side along the Durand Line must be approved by both countries.

Imtiaz Gul, director of the Islamabad-based Centre for Research and Security Studies, said: "It's a very long border, 2,560 km; there's a history of such skirmishes taking place between the two sides."

He said he has spoken with Pakistani officials and Afghan diplomats regarding the tension as recently as the past week.

"We have been speaking with Pakistani officials, as well as with some American diplomats, directly dealing with the issue," he said. "In the past week, they thought that the issue had been resolved. What actually triggered the latest round of fire is still triggered in mystery."