Dwayne Johnson just attended a graduation ceremony for a six-month inmate boot camp program run by the Miami-Dade County Corrections and Rehabilitation Department.

The "Ballers" star, who is working on a documentary about the program called "Rock & a Hard Place," spoke at the commencement gathering earlier this week.

"Congratulations," Johnson said to the graduates. "We're all very, very proud of you."

Johnson may be a versatile, successful entertainer now, but he explained to the grads that he had trouble with the law as a teen and knows a little something about their position. His past run-ins with the law inspired him to do the documentary.

"When I was 13 or 14, I started getting arrested, doing a lot of things I shouldn't have been doing," he said. "And I wanted them to know that life does go on and they're going to have another opportunity."

"[Six] months ago these youth offenders all faced prison time anywhere from [five years] to life for a variety of crimes ranging from armed robbery to attempted murder," Johnson wrote in an Instagram post. "In front of the judge on the day of their sentencing they accepted to be placed in an extremely hardcore one of kind bootcamp. I gave them my word on their first night that [they] would be broken down in ways they never knew imaginable... but if they stuck with it and didn't quit, they'd be built back up to become better men. That was 6 months ago. TODAY, in front of their families, drill instructors and judges they graduate and become free men. Stronger men. Better men."

But it wasn't all pride and excitement for Johnson. He posted another image on Instagram of himself looking disappointed and explained that two men who started the boot camp process didn't finish because they committed crimes along the way.

"I came to the prison today to see two young men who were sentenced to our Dade County Boot Camp, but midway thru their six month stint they committed a crime and now both are looking at serving hard time for up 90 YEARS," he wrote in the caption of the picture above. "I'd been following their progress over the past months and today was the day they WOULD'VE graduated and been free young men. Now it's done and [their] future is bleak. Looked em both in the eyes and they know they fucked up and there's a heavy price they'll pay. It's also a reminder that no matter who we are or what we do, there's always consequences to every action."

In one of his Instagram posts, Johnson compares America's high recidivism rate, which is over 75 percent, to this program's recidivism rate, which is less than 10 percent.

"[O]ver 70% of inmates released from prison will commit a crime and return back to prison," he wrote. "Staggering. Here in Miami, we have one of the most hard core and unrelenting bootcamp prisons in the world. And our rate of recidivism is 8%. EIGHT PERCENT. I told these young men 6 months ago when they first arrived that the life they once knew, was over. That they would get broken down to their core - physically and mentally in ways they never imagined - but I also told them they would never break. Big difference. They never broke and today they graduate and become free men. Better men. Very proud of this program, its staff and the impact it has on our prison system and more importantly, caring about young lives that matter."

Johnson is not the first to highlight the value in not giving up on inmates and treating them like humans. Earlier this year, ATTN: wrote about Norway's Halden Prison, which spends about triple the amount on its average prisoner (about $90,000) than is spent in the U.S. Halden inmates receive amenities such as fridges, TVs, and showers. While this might sound overly generous given the circumstances, "at the heart of this approach is a philosophy that appears to be effective," as we previously noted. Norway's recidivism rate is 20 percent, which is among the lowest in the world, according to a March 2014 report from Rhode Island's Salve Regina University.