The war in Ukraine is at risk of escalation because of Russian setbacks, German Chancellor Olaf Scholz warned on Tuesday.

Scholz speculated that Russia's recent string of military failures could goad the country into escalating the war.

"In view of the development of the war and Russia's visible and growing failures...we must be ready for an escalation," Scholz said at a Berlin conference hosted by the Sueddeutsche Zeitung newspaper.

Germany has been one of Ukraine's strongest allies throughout the invasion, accepting refugees and providing humanitarian aid since the onset of the conflict. Scholz, who succeeded longtime German Chancellor Angela Merkel, has committed Germany to defending Ukraine.

During his visit to China earlier in November, Scholz spoke with Chinese leader Xi Jinping about reports Russia planned to use nuclear weapons in Ukraine. The leaders cast a united front against the possibility, chastising Russia for raising the stakes.

"President Xi and I agree: nuclear threats are irresponsible and incendiary," Scholz told reporters after the meeting with the Chinese leader. "By using nuclear weapons, Russia would be crossing a line that the community of states has drawn together."

Russian leader Vladimir Putin has denied his country is prepared to use nuclear weapons, dismissing the accusations as Western propaganda.