PESHAWAR, Pakistan  Pakistan government officials said they struck a deal on Monday to accept a legal system compatible with Shariah law in the violent Swat region in return for peace.

The agreement contradicted American demands for the Pakistan authorities to fight harder against militants, and seemed certain to raise fears in Washington that a perilous precedent had been set across a volatile region where U.S. forces are fighting Taliban militants operating in Afghanistan and Pakistan.

The latest sign of the battle came early on Monday when a suspected United States drone fired four missiles into another area of northwestern Pakistan, close to the Afghan border, killing 31 people, according to a government official and a resident.

The deal on the Swat region was conditional on both sides fulfilling their side of the bargain, government officials said.