Mark Wahlberg
Mark Wahlberg is now a high school graduate. Tumblr

Actor Mark Wahlberg can now add “high school graduate” to his extensive resume, after graduating at the age of 42. The “Pain & Gain” star, who dropped out after the ninth grade after run-ins with the law, accomplished his goal by taking classes online while on the road and filming various projects.

“I was fortunate to find out I could attend high school online. For almost a year, I’ve been taking classes and studying any chance I could get -- on the set, traveling for work and at home,” the actor wrote in a Huffington Post op-ed. “It has been both humbling and challenging, but I’m happy to report that I am officially a high school graduate, having received my diploma this summer.”

The father of four also admits that he's very fortunate to have become such an accomplished actor in Hollywood without completing his education. “Most high school dropouts don't end up with successful careers in Hollywood. I was lucky," he said. "Compared with high school graduates, dropouts are more likely to be unemployed, in poor health, living in poverty or on public assistance."

Wahlberg encouraged others to take his experience as an example to always stay motivated. “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."

The former model isn't the first celebrity to admit to graduating high school well beyond the age of 18. In October, Drake admitted that he completed high school at the age of 25.

The rapper dropped out of school to star on the hit show “Degrassi” in Canada.

"At one point in my life, I was a kid who was lost," he told San Francisco radio station KMEL in 2010. "I knew I wanted to do music, but, I dropped out of high school against my mother's wishes."

Drake says that he was inspired to go back to school after being a guest coach in 2009 for a scrimmage at the University of Kentucky after being invited by their coach, John Calipari. Drake and the team bonded, and he revealed to Kentucky Sports Television, “I actually dropped out of high school, which I don't know if a lot of people know that. But I dropped out of high school.

"I never got like a great school experience, and when Coach Cal asked me to come here for the first Midnight Madness it just really gave me a sense of school, a sense of love, a sense of belonging to something. So that's why I feel like I belong to the UK family, and that's why I'm graduating from high school this month. So, I'm actually inspired by UK, inspired by these boys right here."

Drake completed his mission in mid-October, and tweeted to his followers, “97% on my final exam. 88% in the course. One of the greatest feelings in my entire life. As of tonight I have graduated high school!”