ISLAMABAD (Reuters) - Pakistan said militants firing from Afghan territory killed four of its soldiers along the border on Sunday, as tensions continued to rise between the neighbors.

Islamabad's Foreign Ministry summoned the Afghan ambassador later on Sunday to protest and demand an investigation.

Afghanistan and Pakistan accuse each other of doing too little to prevent Taliban fighters and other Islamist militants from operating on their territory.

The Pakistani army's press wing said four soldiers had "embraced Shahadat (martyrdom)" and four others had been wounded by mortars fired across the Afghan border in the 8,000 foot (2,400 meter)-high Akhandwala Pass.

"Pakistani troops befittingly responded and eliminated the group of terrorists," the statement said.

Afghan Ambassador Janan Mosazai was summoned for the second time in a week by the Pakistani government and told "such incidents do not augur well for the positive trajectory of relations," a statement from Pakistan's Foreign Ministry said.

Afghanistan recently accused Pakistan of not doing enough to arrest Afghan Taliban leaders who have been meeting to decide on a successor to the group's founder Mullah Mohammad Omar, whose death was confirmed last month.

Kabul officials say the Taliban are meeting semi-openly in Pakistan. Islamabad insists any such meetings are held in Afghanistan.

Afghan officials have long accused Pakistan of tolerating or even supporting the Afghan Taliban, a charge denied by Pakistan.

For its part, Islamabad says the leadership of the Pakistani Taliban - a group loosely allied with the Afghan Taliban but fighting mostly against Pakistan's government - is based in Afghanistan.

Last year new Afghan President Ashraf Ghani made closer ties with Pakistan a priority, hoping Islamabad could push Afghan Taliban leaders to the bargaining table to end Afghanistan's long war.

The new relationship appeared to yield fruit last month with groundbreaking first official peace talks with the Taliban. But after the news of Mullah Omar's death, the process was suspended and the Taliban launched a wave of attacks in Kabul.