Locked up since he was a teenager, Roy Middleton basked in a moment of renewal one recent evening at a chapel in the D.C. Correctional Treatment Facility. He was about to be released after spending more than half his life behind bars for a murder in the nation’s capital. His fellow inmates, who were also his classmates, clapped and cheered. “Freedom!” someone yelled.

“The man of the hour,” a professor called him. The president of Georgetown University embraced him in a receiving line.

By happenstance, Middleton’s celebration was twofold.

First, a D.C. judge ruled Dec. 17 that 24 years of incarceration was enough for the crime Middleton committed at age 16. His original sentence, 35 years to life, was cut to time served.

Second, Middleton was one of about 50 inmates honored that evening for completing fall classes Georgetown University offered at the D.C. jail.

As he reenters society at 41, Middleton will have a Georgetown transcript with 15 units of college credit.

“I got a 4.0 GPA, too,” he said.

The event reflected a growing national movement to offer higher education to those who are incarcerated. One goal is to provide prisoners with skills and credentials that might prove useful when they are released and looking for a job. Another is to reduce the risk that they will commit more crimes and return to prison.

A recent PBS documentary, “College Behind Bars,” spotlights the pioneering efforts of Bard College to help prisoners in New York earn college degrees.

“It’s a common-sense solution to make postsecondary education more widely available in prison,” said Margaret diZerega, project director at the nonprofit Vera Institute of Justice, based in New York, which seeks lower incarceration rates and improved conditions for prisoners. “It’s one of those issues where we do see a lot of bipartisan support.”

The Obama and Trump administrations have both backed an experiment launched in 2015 that allows prisoners to take courses funded through federal Pell Grants. Ordinarily, prisoners are ineligible for the grants.

In its first two years, the initiative awarded $35.6 million to help 40 colleges and universities educate about 8,800 prisoners. In June, Education Secretary Betsy DeVos called for the experiment to be made permanent. Many in Congress want to go further and repeal the federal ban on Pell Grants for prisoners, enacted in 1994.

The prison education movement has private funding, too. On Dec. 9, Georgetown won a $1 million grant from the Andrew W. Mellon Foundation to expand the university’s prison scholars program.

Launched at the D.C. jail last year, the program aims to offer courses next fall in the Maryland prison known as the Patuxent Institution, said Marc M. Howard, a Georgetown professor of government and law who oversees the effort.

Howard said the goal is to establish a path for Maryland inmates to earn Georgetown bachelor’s degrees. Begun with seed funding from the university, the program is backed by private donors. Howard said Georgetown also has applied to participate in the federal Pell experiment.

Georgetown is not the only university with a presence at the D.C. jail. American and Howard universities have offered noncredit classes there, according to D.C. corrections officials. The University of the District Columbia has the oldest educational partnership with the jail, officials said. There is also an online program from Ashland University.

Formally known as the Central Detention Facility, the jail is next to the Correctional Treatment Facility in a fortified complex in Southeast Washington near the Anacostia River. The two facilities, linked by a catwalk, hold an average of about 1,850 inmates. Many are awaiting trial or sentencing. Others are serving sentences for misdemeanors, and some are felons finishing their terms or awaiting court dates in the District.

D.C. officials leaped at the chance to bring Georgetown’s prestigious brand to the jail. When Howard, the Georgetown professor, floated the idea in December 2017, the director of the D.C. Department of Corrections, Quincy L. Booth, replied immediately. “Quincy said — I’ll modify this slightly — ‘Heck, yeah!’ ” the professor recalled.

Georgetown began in January 2018 with 34 male and female inmates taking noncredit classes in English, philosophy, music, debate and government. Credit-bearing courses were added in fall 2018. Instruction takes place in the Correctional Treatment Facility.

In the latest semester, inmates could take three classes for credit — personal finance, prisons and punishment, and philosophy of law — and six not for credit. Undergraduates from the main campus joined them for the prisons and punishment course.

“It’s been such a humbling experience,” one of those “outside” students, Haley Wierzbicki, told the inmates Tuesday. The 21-year-old junior from North Carolina said she marveled at the “inside” students. “How open, welcoming and vulnerable you are,” she said. “We think the world of you.”

Howard, who taught prisons and punishment, said the inside-outside combination was powerful. “Same material, same grades, same credit, same assignments,” he said. “This is the next level — treating students as equals.”

Georgetown President John J. DeGioia congratulated the inmates. As a Catholic and Jesuit university, DeGioia said, Georgetown “takes seriously our educational mission and our responsibility to address issues of social and racial justice.”

He alluded to a stain on Georgetown’s history much publicized in recent years: The 1838 sale of 272 enslaved people of African descent. Two Jesuit priests who were early presidents of Georgetown orchestrated the deal to raise money so the school could pay off its debts.

“We benefited from the injustice of slavery,” DeGioia told the inmates, many of whom are African American. “We still grapple with the legacy of this injustice today.”

After his remarks, DeGioia shook hands with those who completed the courses. The inmates wore regulation orange jailhouse pants but donned blue or gray Georgetown T-shirts for the occasion. They welcomed DeGioia to what they termed Georgetown’s “Southeast campus,” let out a “Hoya Saxa” school cheer as they posed for a group picture, and exclaimed over the Georgetown men’s team that had just won a national soccer championship.

“I’m extremely proud,” said Joel Castón, 43, who like Middleton earned nine credits in the fall. “With Georgetown’s reputation, you know you’re getting a quality education.” Castón said he grew up in the District and attended Ballou, Anacostia and Eastern high schools without graduating. He said he is serving a life term for homicide.

Castón said he was glad Georgetown won the $1 million Mellon grant but believes much more is needed. “This is so profound, what we’re doing here,” he said. “We need the floodgates to open. . . . We can actually change the world from the inside out.”

The event in the small octagonal chapel ended with the inmates dining on pizza, chicken parmesan, mushroom ravioli and baked ziti, seated beneath two slow-turning ceiling fans. DeGioia said it was his first time inside the jail. “An in­cred­ibly moving experience,” he said.

Judith Lichtenberg, a Georgetown philosophy professor who has taught at the D.C. jail and at a Maryland prison, said many conversations in her philosophy of law class turned to punishment, race and crime. The inmate scholars “often blow your mind with stories or arguments based on the kind of experience most students have not had,” she said.

Lichtenberg said she usually doesn’t go out of her way to ask inmates why they are in jail. She knows many did terrible things. “But you’re encountering them as students and human beings,” she said.

The record shows that Middleton shot and killed an unarmed 18-year-old named Keith Jenkins on Nov. 21, 1994. Middleton’s attorneys said he was at the time scared that he would be attacked by a street gang as he walked home from school. He grew up “surrounded by extreme violence,” they wrote, and that shaped his response when he got into a fight with Jenkins.

“Fearing for his life, Middleton made a terrible decision,” they wrote in a 2018 petition for a reduced sentence. The motion was filed under a D.C. law that allows judges to reduce punishment in certain cases for prisoners who committed crimes before they were 18 years old but have shown evidence of rehabilitation.

Prosecutors opposed the petition, arguing in a court document that Middleton had not yet adequately demonstrated acceptance of responsibility and empathy for victims. D.C. Superior Court Judge Milton C. Lee ruled in Middleton’s favor.

In prison, Middleton sought to recover opportunities he had missed. He passed a general educational development test at a federal penitentiary in Indiana in 2001 and was the valedictorian of the GED class there, according to his attorneys. In all, he completed more than 60 educational courses while incarcerated, the attorneys wrote, and earned a degree in ministry.

On Tuesday, Middleton described himself as “beyond excited” at the prospect of starting over. Georgetown’s courses, he said, taught him the value of study habits and discipline. He appreciated that inmates were given the same demanding curriculum as other university students. To be treated equally, he said, “definitely affects your esteem, your self-worth, your pride.”

At 10:30 p.m. that night, Howard posted on Twitter a nine-second video of Middleton’s exit from jail. His mother jumped up and down until he walked into her arms. “Welcome home, Roy!” the professor wrote.