From the edge of a steep mountain overlooking a desert compound built into an old rock quarry, machine gunfire echoes just outside hangars where U.S. special operations forces are training Jordanian commandos.

The Americans, who arrived in the kingdom a few weeks ago at the request of the Jordanians, are helping them develop techniques to protect civilians in case of a chemical attack from neighboring Syria, according to Jordanian officials.

On the Syrian border farther north, British military officers recently assessed the dangers of rockets constantly falling on the kingdom and ways to shield the Jordanian population and Syrian refugees as President Bashar Assad widens his military offensive against rebel enclaves in the vicinity, according to Jordan-based Western diplomats.