President Barack Obama spent the morning in jail Thursday. The United States commander in chief visited El Reno Federal Correctional Institution in El Reno, Oklahoma, as part of his push for criminal justice reform. While at the medium-security facility, Obama saw cells, met with inmates and called for improved rehabilitation programs.

Obama's brief stop at El Reno was the first time a sitting U.S. president has visited a federal prison. While there, he gave an eight-minute speech on the importance of reducing overcrowding by limiting lengthy terms for nonviolent crimes, according to a White House pool report. "We have to consider whether this is the smartest way for us to both control crime and rehabilitate individuals," Obama said.

He told reporters he was especially moved by his visits with young inmates at the prison, which houses about 1,300 men. In his speech, Obama said he wasn't excusing their offenses but instead looking at how they could be diverted from jail or prevented from ever getting into trouble. About 71,000 of the 2.2 million prisoners in the U.S. were minors, Business Insider reported.

Photo: Getty Images

Photo: Getty Images

Photo: Getty Images

"When they describe their youth, these are young people who made mistakes that aren't that different from the mistakes I made, and the mistakes that a lot of you guys made," Obama told reporters. "The difference is that they did not have the kind of support structures, the second chances, the resources that would allow them to survive those mistakes."

Photo: Getty Images

Photo: Getty Images

Photo: Getty Images

The president also discussed prison reform earlier in the week at the annual NAACP convention in Philadelphia. Speaking Tuesday, he said the criminal justice system was "skewed by race and wealth" and that prisons shouldn't tolerate rape or gang activity, CNN reported. Obama also told attendees he'd requested Attorney General Loretta Lynch to look into the possible overuse of solitary confinement.