BEIJING — China rejected a request by an American warship to make a port visit to Hong Kong next month, officials from both nations said on Tuesday, as tensions between the two countries flared on military as well as economic fronts.

The cancellation of a planned visit by the Wasp, an amphibious assault ship carrying a contingent of Marines, followed China’s decision to recall a senior admiral who was in the United States for a naval conference this week.

Both actions were prompted by a Trump administration decision to impose sanctions on a Chinese state military company linked to the People’s Liberation Army for buying weapons from Russia. Although the economic impact of the American action on the Chinese remains unclear, the vehemence of Beijing’s response suggested that the move stung.

The mounting military tensions came only three months after Defense Secretary Jim Mattis visited Beijing pledging “to keep our relationship on the right trajectory.” Instead, the relationship appears to be veering wildly off track as an escalating trade war becomes conflated with broader concerns in Washington about China’s policies.