U.S. Central Intelligence Agency Director William Burns said on Saturday that China is closely monitoring Russia’s conflict in Ukraine and that it is affecting Chinese leaders’ calculations over Taiwan, the self-ruled island claimed by Beijing.

Burns, speaking at a Financial Times event in Washington, said the Chinese government had been struck by Ukraine’s fierce resistance to Russia’s invasion and by the economic costs Russia is bearing.

“I think the Chinese leadership is looking very carefully at all this – at the costs and consequences of any effort to use force to gain control over Taiwan,” Burns said.

He cautioned, however, that it would not shift Chinese leader Xi Jinping’s long-term goals over Taiwan.

“I don’t for a minute think that this has eroded Xi’s determination over time to gain control over Taiwan,” he said. “But I think it’s something that’s affecting their calculation about how and when they go about doing that.”

China has refused to condemn Russia’s war in Ukraine and has criticized Western sanctions on Moscow.

Beijing and Moscow declared a “no-limits” strategic partnership several weeks before the February 24 invasion and have been forging closer energy and security ties in recent years to push back on the United States and the West.

But Burns said the United States believed China was unsettled by the reputational damage of being associated with the “brutishness” of Russian President Vladimir Putin’s military action.

“I think what the bitter experience, in many ways, of Putin’s Russia in Ukraine over the last 10 or 11 weeks has done is demonstrate that that friendship actually does have some limits,” Burns said.