DAKAR, Senegal — Gunfire erupted overnight in Banjul, the capital of the West African nation of Gambia, and residents awoke Tuesday to find government buildings and the main bridge into town sealed off by fidgety soldiers.

The United States Embassy reported an attempted coup, even as the Gambian government issued a vague statement that “peace and calm continue to prevail in the Gambia.”

Residents said that shooting began around 1 a.m. near the seat of government. After day broke, most establishments in the island capital remained closed despite regular broadcasts on state-run radio urging businesses to open.

Westerners living in Gambia, which juts like a stake into its larger neighbor, Senegal, awoke to emails from their embassies urging them to stay indoors.