ANKARA, Turkey — A U.S. withdrawal from Syria that has not been thought through would lead to “chaos” and “an Iraq on steroids,” Sen. Lindsey Graham warned Saturday, urging President Donald Trump not to get out without a plan.

Speaking to reporters in the Turkish capital Ankara a day after meeting with Turkish officials, the Republican senator from South Carolina said a plan to withdraw from Syria should ensure that the Islamic State group is defeated, that Iran is contained and that Turkey is protected from threats from Kurdish rebels.

Graham said the goal of destroying IS militants in Syria has not yet been accomplished.

“I am urging President Trump not to do what President Obama did, which is just to get out and not to understand what happens when you just get out,” he said.

Graham was referring to Obama’s decision to pull U.S. forces from Iraq in 2011, ending the occupation of the country since 2003. In 2014, Obama redeployed troops to Iraq at the invitation of the government to stop Islamic State militants from advancing on Baghdad. Some 5,200 troops remain in Iraq today and IS was defeated in its last urban stronghold only a year ago.

A U.S. withdrawal from Syria without a plan would lead to an “Iraq on steroids,” he said.

The senator added that the Turkish and U.S. defense chiefs were working on a plan to move Syrian Kurdish militia away from the border with Turkey, but did not provide further details.

Trump has raised the possibility of creating a “safe zone” at the border with Turkey in an apparent bid to prevent a possible Turkish military operation against a Syrian Kurdish militia. The group was allied with the United States in the fight against IS but Turkey views the fighters as “terrorists” and a major national security threat.

Graham said he also discussed the killing of Saudi journalist Jamal Khashoggi at the Saudi Consulate in Istanbul in October and said the U.S. and Saudi Arabia cannot move forward in their relationship until Saudi Crown Prince Mohammed bin Salman — who has been accused by some of complicity in the killing — is “dealt with.” He did not elaborate.

A prominent voice on foreign affairs in the U.S., Graham met with Turkish President Recep Tayyip Erdogan and also held discussions with the foreign affairs and defense ministers and Turkey’s intelligence chief.