Mark Wahlberg Earns High School Diploma

Mark Wahlberg 2 Guns Premiere - P 2013
Getty Images

Mark Wahlberg 2 Guns Premiere - P 2013

The actor took classes online and finally graduated this summer, after dropping out when he was in the ninth grade.

Mark Wahlberg has finally gotten his high school diploma, at age 42, after dropping out in the ninth grade.

The actor graduated after taking classes online for almost a year and "studying any chance I could get -- on the set, traveling for work and at home," he wrote in an essay for The Huffington Post.

VIDEO: 'Lone Survivor' Trailer

"I was able to do it because I knew I wasn't alone, that other teens and adults were going through the same thing I was in balancing work and family in order to better themselves," Wahlberg writes. "To those students struggling every day and -- most importantly -- to those who are looking for a second chance, I have a message for you: Never give up. Keep believing in yourselves and don't make small plans."

He adds: "I can now look at my kids every day knowing that I didn't just do this for me -- I did it for them, and I did it for all the other teens and adults who have inspired me by their commitment to graduate."

Wahlberg has used his own experience to help others graduate high school, noting that dropouts are more likely to be unemployed, in poor health, living in poverty or on public assistance.

STORY: Mark Wahlberg, '2 Guns' Writer, Director Talk Making Deals and Action Movies

Through his Mark Wahlberg Youth Foundation charity, he's partnered with organizations that give teens the tools and support they need to graduate high school, resources Wahlberg says he wishes he had access to as a teen.

Now that he's graduated, Wahlberg, who most recently starred opposite Denzel Washington in Universal's 2 Guns, will next be seen in Peter Berg's Lone Survivor.