In an interview published on Thursday, President Obama responded to Iraq War boosters who claim that their only regret about the invasion was that he eventually became president and didn’t see it through.

The Atlantic’s Jeffrey Goldberg asked Obama about former Florida Gov. Jeb Bush’s (R) struggle last week to answer whether he would have invaded Iraq given what he knows now.

“I’m very clear on the lessons of Iraq. I think it was a mistake for us to go in in the first place, despite the incredible efforts that were made by our men and women in uniform,” Obama responded. “Despite that error, those sacrifices allowed the Iraqis to take back their country. That opportunity was squandered by Prime Minister Maliki and the unwillingness to reach out effectively to the Sunni and Kurdish populations.”

Obama then pivoted to the current situation in Iraq and responded to Republicans, including Sen. Lindsey Graham (R-SC) and Louisiana Gov. Bobby Jindal (R), who blamed Obama for the current instability in Iraq.

“I know that there are some in Republican quarters who have suggested that I’ve overlearned the mistake of Iraq, and that, in fact, just because the 2003 invasion did not go well doesn’t argue that we shouldn’t go back in,” Obama said. “And one lesson that I think is important to draw from what happened is that if the Iraqis themselves are not willing or capable to arrive at the political accommodations necessary to govern, if they are not willing to fight for the security of their country, we cannot do that for them. We can be effective allies.”

Obama said he is committed to assisting Iraqi security forces to help them secure and stabilize the country.

“But we can’t do it for them, and one of the central flaws I think of the decision back in 2003 was the sense that if we simply went in and deposed a dictator, or simply went in and cleared out the bad guys, that somehow peace and prosperity would automatically emerge, and that lesson we should have learned a long time ago,” he told The Atlantic.

Earlier in the interview, Obama said that he does not believe the U.S. is losing the war against the Islamic State, but said that ISIL’s ability to take Iraqi city of Ramadi was a “tactical setback.”