WASHINGTON - Donald Trump insisted that the battle to reclaim Mosul was motivated by the Obama administration's desire to help Hillary Clinton get elected president. He based this claim on the fact that retaking Mosul isn't worth it. The Associated Press quickly fact-checked that assertion.

DONALD TRUMP: "We don't gain anything" by restoring Iraqi government control of Mosul. "Iran is taking over Iraq."

THE FACTS: Actually, "we" do. Mosul is Iraq's second-largest city and has been the Islamic State's main stronghold in Iraq for more than two years. The city that was once home to about 2 million people is believed to still have 1 million residents living under harsh Islamic State conditions. Forcing the extremists out of Mosul has been widely seen as an important step toward breaking the group's grip on northern Iraq and depriving it of its key revenue streams. Islamic State fighters had begun to flee the city in anticipation of an onslaught by Iraqi Kurdish forces and the Iraqi military.

Defense Secretary Ash Carter said when the Iraqi assault began on Monday that it marked a "decisive moment" in the broader effort to defeat the Islamic State.

It is true that Iran has gained more influence in Iraq since the U.S. invaded to topple Saddam Hussein in 2003, but Iran is not in control of Iraq.

Read More: Final debate: Trump refuses to commit he'll accept election results | Snap poll: Clinton beat Trump | Analysis: The thing Trump said that may doom his campaign | Despite misgivings, Russians in American will vote Trump

Full transcript of the exchange:

Wallace: Hold on, folks. This doesn't do any good for anyone. Let's please continue the debate and move on to the subject of foreign hot spots. The Iraqi defensive to take back Mosul has begun. If they're successful in pushing ISIS out of that city and out of all of Iraq, the question then becomes what happens the day after. And that's something that whichever -- whoever of you ends up as president is going to have to confront. Will you put U.S. troops into that vacuum to make sure ISIS doesn't come back or isn't replaced by something even worse? Secretary Clinton, you go first in this segment. You have two minutes.

Clinton: Well, I am encouraged that there is an effort led by the Iraqi army, supported by Kurdish

forces and also given the help and advice from the number of special forces and Americans on the ground. I will not support putting American forces into Iraq as a force. I don't think that is in our interest and I don't think it would be smart to do. Chris, I think that would be a big red flag waving for ISIS to reconstitute itself. The goal here is to take back Mosul. It's going to be a hard fight. I've got no illusions about that. And then continue to press into Syria to begin to take back and move on Raqqah, which is the ISIS headquarters.

I am hopeful that the hard work that American military advisers have done will pay off, and that we will see a really successful military operation. But we know we've got lots of work to do. Syria will remain a hotbed as terrorism as long as the civil war aided and abetted by the Iranians and the Russians continue.

So I have said look, we need to keep our eye on ISIS. That's why I want to have an intelligence surge that protect us here at home while we have to go after them from the air, on the ground, online. Why we have to make sure here at home we don't let terrorists buy weapons. If you're too dangerous to fly, you're too dangerous to buy a gun. And I'm going to continue to push for a no-fly zone and safe havens within Syria. Not only to help protect the iranians and prevent the constant outflow of refugees, but to frankly gain some leverage on both the Syrian government and the Russians so that perhaps we can have the kind of serious negotiation necessary to bring the conflict to an end and go forward on a political track.

Wallace: Mr. Trump, same question. If we are able to push ISIS out of mosul and out of Iraq, would you be willing to put U.S. Troops in there to prevent their return or something else?

Trump: Let me tell you, Mosul is so sad. We had Mosul. But when she left, she took everybody out, we lost Mosul. Now we're fight again to get Mosul. The problem with Mosul and what they wanted to do is they wanted to get the leaders of ISIS who they felt were in Mosul. About three months ago, I started reading that they want to get the leaders. And they're going to attack Mosul. Whatever happened to the element of surprise? Okay? We announce we're going after Mosul. I've been reading about going after mosul now for how long? Three months? These people have all left. They've all left. The element of surprise. Douglas MacArthur, George Patton spinning in their graves when they see the stupidity of our country. So we're now fighting for mosul that we had. All she had to do is stay there. Now we're going in to get it. But you know who is big winner in mosul is going to be after we eventually get it? And the only reason they did it is because she is running for the office of president, and they want to look tough. They want to look good.

He violated the red line in the sand. And he made so many mistakes. Made all mistakes. That's why we have the great migration. But she wanted to look good for the election. So they're going in. But who is going to Mosul, really? By the way, much tougher than they thought.

Much tougher, going to be more deaths than they thought. But the leaders we wanted to get are all gone because they're smart. They said what do we need this for? So Mosul is going to be a wonderful thing, and Iran should write us a letter of thank you, just like really stupid, the stupidest deal of all time.

A deal that is going to give Iran absolutely nuclear weapons. Iran should write us yet another letter saying thank you very much. Because Iran, as I said many years ago, Iran is taking over Iraq. Something they've wanted to do forever. But we've made it so easy for them. So we're now going to take Mosul. And you know who is going to be the beneficiary? Iran. Boy are they making — I mean, they are outsmarting. Look, you're not there. You might be involved in that decision. But you were there when you took everybody out of Mosul and out of Iraq. You shouldn't have been in Iraq. But you did vote for it. You shouldn't have been in Iraq. But once you were in Iraq, you should have never left the way.

Wallace: Sir, your two minutes are up.

Trump: The point is the winner is going to be Iran.

Clinton: Well, once again, Donald is implying that he didn't support the invasion of Iraq. I said it was a mistake. I said that years ago. He has consistently defined knight --

Trump: Wrong.

Clinton: What is a very clear fact.

Trump: Wrong.

Clinton: That before the invasion he supported it. I just want everybody to go Google it. Google Donald Trump Iraq and you will see the dozens of sources which verify that he was for the invasion of Iraq.

Trump: Wrong.

Clinton: And you can actually hear the audio of him saying that. Now why does that matter? Well, it matters because he has not told the truth about that position. I guess he believes it makes him look better now to contrast with me because I did vote for it. What's really important here is to understand all the interplay. Mosul is a Sunni city. Mosul is on the border of Syria. And yes, we do need to go after Baghdadi, just like we went after bin laden while you were doing Celebrity Apprentice, and we brought him to justice. We need to go after the leadership, but we need to get rid of them, get rid of their fighters, their estimated several thousand fighters in Mosul.

They've been digging underground. They've been prepared to defend. It's going to be tough fighting. I think we can take back mosul and move on into Syria and take bacharach ca. This is what we have to do. I'm just amazed that he seems to think that the Iraqi government and our allies and everybody else launched the attack on mosul to help me in this election. But that's how Donald thinks, you know. Looking for some --

Trump: Chris, we don't gain anything. Iran is taking over Iraq.

Wallace: Secretary Clinton --

Trump: Iran is taking over Iraq.