Pakistani President Pervez Musharraf has conceded that some border security forces have been letting Taleban fighters cross into Afghanistan.
Gen Musharraf said it was difficult for the security forces
He said that there had been incidents in which guards had turned "a blind eye" to the militants.
He again denied that his intelligence services were helping the Taleban.
The Afghan government and Nato forces have been critical of border security and called on Pakistan to do more to curb cross-border militant activity.
The president has also come under fire for pacts with tribal militants in the North and South Waziristan areas.
Critics say the deals give Taleban fighters based there freedom to go where they please.
"We had some incidents I know of that in some [border] posts, a blind eye was being turned," President Musharraf told a press conference in Rawalpindi when asked about criticism of Pakistan's role in the US-led war on terror.
"So similarly I imagine that others may be doing the same."
Militants say they can move around the border area with impunity
The president said that it would be difficult for two border guards on a typical check post on the Afghan border when they are faced with a group of "20 well-armed, well-trained and well-motivated people challenging them".
The BBC's Haroon Rashid on a recent visit to the South Waziristan region met tribal militants allied to the Taleban who openly admitted crossing over into Afghanistan to fight foreign troops.
Gen Musharraf repeated Pakistani complaints that his country was being made "a scapegoat" for the resurgence of Taleban-led militants.
He pointed out that Afghan authorities, and US and Nato-led troops in Afghanistan shared responsibility for the border.
"A misperception is being created that the resurgence of Taleban is from Pakistan. This is absolutely wrong. The resurgence of the Taleban is in Afghanistan, but some support goes from Pakistan," he said.
The president also gave details of Pakistan's plans to build a fence along the Afghan border.
He said it would be 35kms (22 miles) long and that the first phase would see fencing erected at seven or eight locations along Pakistan's northwest frontier, which would take a "few months" to be completed.
"The decision has been taken and movement of logistics must be taking place at the moment," he said.
President Musharraf said mines would not be used in the first phase because of concerns raised by the international community.
But he said that it was possible that fencing and mines would be used to secure 250kms (150 miles) of the frontier further south, in Balochistan province.
"No one has the right to criticise unless they come up with an alternative solution ... if there is no (other) solution, we will do it our way," the president said.
Turning to relations with India, the president said that confidence-building measures under the peace process that began three years ago were going well.
He said that he was "fairly optimistic" that the two governments would be able to move forward to resolve all issues in dispute, including the Kashmir question.
"Our relations have never been this good before in our history, and we ought to be happy about that," he said.