WASHINGTON  Pakistani and American ground troops exchanged fire along the border with Afghanistan on Thursday, a top American military official said, ratcheting up tensions as the United States increases its attacks against militants in Pakistan’s restive tribal areas.

The clash started after the Pakistanis fired shots or flares at two American helicopters that Pakistan says had crossed its border.

The two American OH-58 Kiowa reconnaissance helicopters were not damaged and no casualties were reported.

But American and Pakistani officials agreed on little else about what happened.

American and NATO officials said that the two helicopters were flying about one mile inside Afghan airspace to protect an American and Afghan patrol on the ground when the aircraft were fired on by troops at a Pakistani military checkpoint near the Tanai district in Khost Province. The officials said small-caliber arms were used.