ISLAMABAD, Pakistan (CNN) -- Militants in northwestern Pakistan attacked a police checkpoint Tuesday and abducted up to 30 police officers, a police official said.
The abductions happened in the Swat valley, a tourist area where security has continued to deteriorate despite a two-month-old peace pact.
Militants surrounded the security checkpoint in the Kabal area, about 22 miles (35 km) north-west of the valley's main town of Mingora, about 5 a.m., said Sardar Rehim Shahzad, district coordinator for Swat police.
The two sides engaged in a gun battle that lasted about three to four hours, Shahzad said. After overpowering the checkpoint, militants took about 30 officers hostage.
"They are taking them by foot to their hideaway, but it is not possible for us to launch a rescue operation because of the security situation and the logistical conditions," Shahzad said.
The attack came a day after militants shot dead three intelligence agents as they were driving back to Mingora in a pickup.
The Swat Valley, in North West Frontier Province, was once Pakistan's biggest tourist destination. It's near the Afghanistan border and about 186 miles (300 km) from the Pakistani capital of Islamabad.
The valley boasted the country's only ski resort until it was shut down last year after militants overran the area. The area was also a draw for trout-fishing enthusiasts and visitors to the ancient Buddhist ruins in the area.
In recent months, however, militants bent on imposing a fundamentalist interpretation of Islamic law, or Sharia, have unleashed a wave of violence across the North West Frontier Province that have claimed hundreds of lives, many of them security personnel.
The militants want to require veils for women, beards for men and ban music and television.
After months of bloody battles, the government reached a peace deal in May with fighters loyal to the banned hardline Islamic group, Tehreek Nifaz-e-Shariat Mohammadi (TNSM).
It is the latest attempt by Pakistan's new government -- headed by the party of the assassinated prime minister Benazir Bhutto -- to achieve peace through negotiations in lawless tribal areas where Taliban and al Qaeda leaders are believed to have free rein.
Ahead of the peace pact, Pakistan's government released TNSM's former leader, Sufi Mohammed, who was jailed in 2002 after recruiting thousands of fighters to battle U.S. forces in Afghanistan.
He was freed after agreeing to cooperate with the government. Under the terms of his release, TNSM was also expected to lay down its arms and forgo violence.
But his son-in-law Fazlullah, who took over TNSM during his jail stint, vowed to continue his fight to impose fundamentalist Islamic law in the region.
CNN's Saeed Ahmed contributed to this report.