President Obama said he wished he had moved faster to close the military prison at Guantanamo Bay, Cuba. (Brendan Smialowski/AFP/Getty Images)

President Obama said Wednesday that he wished he had brushed aside Republican objections and closed the military prison at Guantanamo Bay, Cuba, during his first days in office.

Obama's remarks on the controversial prison, which was opened in the wake of the Sept. 11, 2001, terror attacks, came in response to a seventh-grader's question following a speech at the City Club of Cleveland. She asked what do-over he would like from the first day of his first term as president.

"I think I would have closed Guantanamo on the first day," Obama responded to applause from the crowd. "I didn’t at that time because we had a bipartisan agreement that it should be closed." Sen. John McCain (R-Ariz.), the Republican presidential nominee, had also championed closing the facility during the 2008 election.

Obama, however, was never able to build enough of a bipartisan consensus to shutter the prison and move the inmates to maximum security facilities in the United States or return them to their home countries. "The politics of it got tough and people got scared by the rhetoric around it," he said. "Once that set in, the path of least resistance was to leave it open even though it is not who we are as a country."

Critics of the facility have said that the Guantanamo prison is routinely used by terrorists as a recruiting tool. In recent months, Islamic State terrorists in Syria have dressed American prisoners in orange jumpsuits, similar to those used in Guantanamo, prior to beheading them.

Instead of closing the facility, the Obama administration has sought to "chip away" at the population by stepping up transfers of prisoners who have been cleared for release but can't be returned to their home countries. About half of the more than 120 prisoners remaining at Guantanamo fall into this category.  The administration's goal is to reduce the population to about 50 or 60 prisoners who are too dangerous to ever be released.