HONG KONG — Vietnam appears to have retreated in a high-stakes maritime gambit against China, suspending a gas-drilling project that it had approved in the South China Sea but that was said to have irritated Beijing.

The drilling, by a subsidiary of the Spanish energy company Repsol, had started in June off the southern Vietnamese coast, analysts said. The offshore block where the drilling was occurring straddles the border of Vietnam’s 200-nautical-mile exclusive economic zone but is challenged by China, Vietnam’s hulking northern neighbor, which is building artificial islands in the sea for its military.

Analysts say the project’s suspension, which Repsol confirmed to Reuters on Wednesday, appears to be another strategic victory for China at a time when the Trump administration is distracted by turmoil at home. They say it also highlights the difficulty that Vietnam faces as it mounts long-shot challenges to Beijing’s claims to the South China Sea — without much help from its neighbors in Southeast Asia or from Washington.

Vietnam’s leaders “can try their best to deter the Chinese” in the South China Sea, said Gregory B. Poling, a fellow in the Southeast Asia program at the Center for Strategic and International Studies in Washington. “But when the Chinese push back hard, like they just did, the Vietnamese are out on a limb all by themselves.”