America can take pride in the changes in Iraq since 2003 — but what happens after December, when all US troops are to have left the country?

Defense Secretary Robert Gates seems worried — and for good reason.

Last Tuesday, Gates repeated his idea to keep some US forces in Iraq beyond the Dec. 31 withdrawal date.

What’s spooking him? One word: Iran.

Keeping troops in Iraq would send “a powerful signal,” Gates said. “I think it would be reassuring to the Gulf states; I think it would not be reassuring to Iran — and that’s a good thing.” (Amen to that.)

Iran has been making mischief in Iraq since Day One of the Iraq War eight years ago. And a new report by the American Enterprise Institute’s Frederick Kagan fi nds that, even today, Iran’s “use of proxy military groups” poses “the most immediate and serious threat to Iraqi security.”

With Baghdad’s military not yet fully up to snuff, the mullahs must be counting the days for America’s departure.

“The Iraqi security forces will not be able to defend Iraq’s sovereignty, maintain its independence from Iran or ensure Iraq’s internal stability without American assistance” for years, Kagan says.

“A security agreement extending the presence of US forces in Iraq beyond the end of 2011 is thus an urgent national security priority.” That’s spot on.

But getting a deal won’t be easy.

For starters, President Obama vowed to bring all the troops home, and you can bet hisleft-wing base will try to hold him to it.

Meanwhile, Iran’s surrogates — notably, anti-US cleric Moqtada al-Sadr, a key ally of Prime Minister Nouri al-Maliki, and his backers — are doing everything possible to see that every last American leaves, including launching attacks on US forces there.

But Iraq’s fate is too vital to be left to the mercy of the mullahs. If Iran manages to turn its neighbor into a puppet state, it’d be a huge blow to the entire region — and to US interests.

Obama’s folks need to pull out all the stops to keep a US presence in Iraq, as a counterweight to Iran.