Joining Rep. Trey Gowdy and Sen. Tim Scott at a Presidential town hall forum in South Carolina Thursday, Governor Rick Perry took questions ranging from entitlement reform to national security.

During a particularly emotional moment, Governor Perry went off script to discuss his deep-rooted feelings about military service.

When asked by an audience member if he would close Gitmo, Perry answered, “listen, I’d keep Guantanamo Bay open. The bad guys don’t need be over here. This president does not know how to, and I’m just going to editorialize here just a little bit — this president does not know how to connect the dots. If he did, we would not be negotiating with Iran today. If he did, we would have the Castro brothers on their knees in Cuba, but we threw them a lifeline.”

Perry continued, “this president does not understand, either he doesn’t have the experience of how foreign policy works, or he is so philosophically out of tune with the vast majority of Americans.”

When the conversation turned to Iraq, Perry’s demeanor changed.

“We have this wreck in Iraq today because this president made a statement during a political campaign to move our soldiers out of there on a date certain and everything is going to heck in a hand basket over there. You’ve got ISIS that has been created over there because this president does not understand how to connect the dots.”

“If we had left a force there to maintain the peace — we won the peace. We got friends that paid an extraordinary price… and we walked away from it so this president could say ‘I kept my political promise.’ He has served us so poorly, and we need a president of the United States who understands and has a passion deep within their heart about what war cost,” said Perry, pulling no punches.

Turning to his gubernatorial experience, Perry said, “I signed a letter a week from 2003 to 2010 to a Texas family who lost a loved one.”

“I understand. Having worn the uniform of this country, I know what our young men and women go through. I had a young Navy SEAL that lived with us for two years, Marcus Luttrell. I know what this war cost. I’ve seen it in their faces. I’ve seen it in the families faces,” said Perry struggling to speak. “We need a president who understands that to their soul and that will never, ever put those young men and women in jeopardy and harms way unless we’ve used up every option that we have.”

Perry shared the story of his paternal relationship with “Lone Survivor” and Navy SEAL, Marcus Luttrell previously.

Follow Kemberlee Kaye on Twitter @kemberleekaye