Donald Trump's foreign policy strategy: build a military so fearsome it never has to fight. EPA/MIKE NELSON

Donald Trump, who has long been opposed to continued U.S. involvement in the wars in Iraq and Afghanistan, said Tuesday that Afghanistan has become such "a mess" that the United States cannot safely withdraw all of its troops and support.

"We made a terrible mistake getting involved there in the first place," Trump told CNN's Chris Cuomo. "It's a mess, it's a mess and at this point we probably have to [leave U.S. troops in Afghanistan] because that thing will collapse in about two seconds after they leave."

In discussing foreign policy, Trump often describes himself as the "most militaristic person" running for president, although he is largely opposed to getting involved in global conflicts, arguing that the United States should invest in rebuilding its own infrastructure instead of spending billions on wars overseas. Trump has been most vocal in his opposition to the war in Iraq, saying that he would have never invaded. But he has also occasionally voiced opposition to U.S. involvement in Afghanistan. Ahead of the 2012 presidential election, Trump said in a video posted on his official YouTube account that the war in Afghanistan is "a total and complete disaster." In January 2013, Trump tweeted: "Let’s get out of Afghanistan. Our troops are being killed by the Afghanis we train and we waste billions there. Nonsense! Rebuild the USA."

[Donald Trump suggests Syrian refugees might be a terrorist army in disguise]

But Trump said in the interview on Tuesday that fully pulling out is no longer an option: "I would leave the troops there, begrudgingly -- believe me, I'm not happy about it."

Trump has said that he wants to build a military that is so fearsome, it will never have to fight. While other Republican presidential hopefuls have said that U.S. should become more involved in the Syrian conflict, Trump has said the U.S. should instead allow Russia to take the lead, working with Syrian President Bashar al Assad to weaken the Islamic State. Trump has said in interviews in the past few days that the war in Syria has become so complicated, involving so many fractured groups, that it would be difficult for the U.S. to directly get involved.

[Donald Trump wants to let Russia fight the Islamic State]