A paramilitary soldier detains a Lashkar-e-Islam suspect
A leading militant in Pakistan's Khyber region, Mangal Bagh, has struck a peace deal with the local administration to end nearly two weeks of fighting.
Paramilitary troops started an operation in late June against Mangal Bagh and other Islamist militants.
It came amid growing concern for security in the nearby city of Peshawar, the capital of North West Frontier Province.
The US says that such peace deals allow militants to flourish.
But Pakistan's new government is committed to ending militant violence through negotiations.
Pakistan's leading militant, Baitullah Mehsud, who is based in South Waziristan, suspended negotiations with the central government in protest at the military action in the Khyber agency.
The BBC's M Ilyas Khan in Islamabad says that under the terms of the Khyber agreement, the paramilitary forces will end the operation and release some activists of Mangal Bagh's Lashkar-e-Islam group.
Mangal Bagh and his men will accept the government's authority and not carry arms in Bara town, Mr Bagh's base.
Our correspondent says that normally there are no restrictions in the carrying of arms on the tribal areas along the Afghan border as tribesmen are often involved in blood feuds and need to defend themselves.
The agreement was mediated by a local jirga, or council of elders.
Earlier this week, four soldiers were killed when there convoy was ambushed in the Akakhel area of the Khyber district. It was the first major attack on troops during the operation.
Two other militant groups were also targeted by the paramilitaries.
Correspondents say that the militants have been increasingly brazen in their activities in Peshawar. In one case, 16 Christians were briefly abducted from the city centre.