Education rehabilitated Richard Gamarra.

Gamarra, an inmate for seven years and one-time Latin King gang member, graduates May 17 with a master’s degree in public health from Columbia University’s prestigious Mailman School of Public Health.

“When there’s a will, there’s a way,” Gamarra told The New York Daily News. “This is historic for me. It’s very humbling. I won’t believe it until I have that diploma in my hands.”

>> Read more trending news

Gamarra, 28, grew up in Flushing, Queens, the youngest of five Colombian immigrant children. He joined the Latin Kings in high school and fought frequently with rival gangs. He was sent to prison for assault and weapons convictions at 19.

There, he met Robert Fullilove, a Columbia professor who taught a public health course to inmates at Woodbourne Correctional Facility.

Fullilove noticed Gamarra’s intelligence immediately and recommended he apply to the Ivy league school.

“A couple of good students always stand out,” Fullilove said. “I told him, ‘Come to Columbia. I’ll make it happen.’ ”

Gamarra worked to turn his life around. He was released in 2013 and graduated with a bachelor’s degree in public health and education from the City University of New York in 2015. He enrolled in the master program at Columbia that fall.

“I don’t want my past to define me,” he said. “I want to undo that stigma of being in prison. I know there are a lot of other Richards out there.”

Gamarra hopes to use his degree to teach and counsel inmates.