BEIJING — China canceled an important annual security meeting planned for mid-October with Defense Secretary Jim Mattis in Beijing, saying a senior Chinese military officer would not be available to meet him, an American official said on Sunday.

The decision to withdraw from the high-level encounter, known as the diplomatic and security dialogue, was the latest sign of bad blood between China and the United States, and capped a week of tit-for-tat actions by both nations as they settled into a newly chilly relationship.

The cancellation of the dialogue, an event that China until recently had advertised as a productive way for the two sides to talk, showed how quickly the tensions over an escalating trade war have infected other parts of the relationship, particularly vital strategic concerns including Taiwan, arms sales and the South China Sea.

A senior American foreign policy official summarized the administration’s attitude to China last week, telling a crowd at the celebration of national day at the Chinese Embassy in Washington that the United States was intent on competing with China — brittle language that is usually absent from formal events.