The U.S. faces a daunting situation in Syria even as it sits on the verge of a military victory over the Islamic State, Sen. John McCain, R-Ariz., warned Tuesday.

As U.S.-backed forces finally liberate the group's self-declared capital of Raqqa, the regime of Bashar al-Assad remains in power with the support of both Iran and Russia, and Syria remains in ruins from years of civil war, the Armed Services chairman said in a released statement.

"The humanitarian devastation and lack of political progress wrought by six years of war leaves fertile ground for future insurgencies," McCain said.

ISIS has been nearly defeated after three years of air and ground operations by the U.S.-led coalition and was down to about 100 fighters in Raqqa and about 6,500 total in Iraq and Syria, the Pentagon said Tuesday.

But the question of what will happen after that military defeat has been looming and was underscored in recent days by clashes in northern Iraq between the Baghdad central government and Kurdish forces.

In Syria, the Russians, the Syrian regime and U.S.-allied Syrian Democratic Forces are increasingly confronting each other as ISIS's territory shrinks to a section of Raqqa and a thin strip along the Euphrates River.

McCain, raising the question of what comes next, said the U.S. lacks a plan and its approach to the Middle East of focusing on counter-terrorism operations must be overhauled with a more holistic strategy by the Trump administration.

"What we need instead is a comprehensive strategy that takes all regional factors into account — a clear articulation of our interests and the ways and means we intend to secure them," McCain said. "The absence of such a strategy is acutely felt even as we celebrate this important success."