EL RENO, Okla. -- Barack Obama got a first-hand look at the U.S. criminal justice system Thursday, becoming the first sitting president to set foot inside a federal prison and meet with incarcerated men there.

Obama's visit to a medium-security prison for male offenders in the state of Oklahoma was part of his push for an alternative to the continued lengthy incarceration of people convicted of crimes he believes did not fit the punishment. Obama has called for shortening the prison sentences of non-violent drug offenders as well as for advocating the reduction, or outright elimination, of severe mandatory minimum sentences.

In a recent speech Obama said that overly harsh prison sentences, particularly for nonviolent drug crimes, are to blame for doubling the prison population in the past two decades. Half a million people were behind bars in 1980, a figure that has since quadrupled to its current total of more than 2.2 million inmates, the highest rate of incarceration in the world.

After peering into a sterile prison cell at the El Reno Federal Correctional Institution, Obama said the U.S. needs to reconsider the way crime is controlled and prisoners are rehabilitated.

Obama, who has vowed to make criminal justice reform a centerpiece of his closing months in office, said he also felt a kinship with some of the young inmates.

"When they describe their youth and their childhood, these are young people who made mistakes that aren't that different than the mistakes I made," Obama said.

The U.S. president said there must be a distinction between young people "doing stupid things" and violent criminals. Young people who make mistakes, he said, could be thriving if they had access to resources and support structures "that would allow them to survive those mistakes."

Obama has also called for restoring voting rights to felons who have served their sentences, and said employers should "ban the box" that asks job applicants about their criminal histories.

The White House said Obama was the first sitting president to visit a federal prison. The presidential motorcade rolled past fences topped with multiple layers of razor wire as it entered the sprawling prison complex.

After his meeting with inmates, Obama walked past rows of empty cells secured by large grey doors. Prison officials opened cell no. 123 for the president, who gazed at its sparse trappings: a bunk bed and third bed along the wall, a toilet and sink, along with a small bookcase and three lockers.

Obama has expressed hope that Congress will send him legislation to address the issue before he leaves office in 18 months, given the level of interest in the issue among Republican lawmakers and presidential candidates.

Obama has said that taxpayers are the ones left to pay the $80 billion annual cost of locking up people who otherwise could be in rehabilitative programs for less than the cost of incarceration. Or they could be workers paying taxes, or be more involved in their children's lives, or be role models and leaders in their communities.

Obama's former Secretary of State Hillary Rodham Clinton has made criminal justice reform part of her presidential campaign agenda.

Clinton said in April that she would push for an end to the "era of mass incarceration."

Her husband, former President Bill Clinton, said Wednesday that the tough-on-crime overhaul he signed into law in the 1990s made the problem of longer prison sentences worse and he wants to "admit it."

The former president said at the convention of the NAACP civil rights group in Philadelphia that the bill came after a "roaring decade of rising crime."

The law put 100,000 more police officers on the streets but also led to longer terms for prisoners. Clinton said there were a lot of people "who were essentially locked up who were minor actors for way too long."