Neil Patrick Harris has opened up about how after so many years, he is finally feeling "comfortable" in his skin while earlier he used to feel "insecure at gyms or at parties."

The 49-year-old actor, who posed for Out Magazine in his underwear, told the magazine about how he spent a large chunk of his life feeling awkward at socializing because of his body.

"I think for a large chunk of my life, in my body, I felt younger than I actually was," he said. "I often felt insecure at gyms or at parties or socializing a lot, because I didn’t feel comfortable in my skin. Now that I’m [49], I’m proud of my journey, and I don’t feel like it’s ending."

Harris proudly shared that he is "still on an upward trajectory. No hip replacements, no knee replacements, no nothing. Not yet."

The magazine took to Instagram on Wednesday to share the cover photo featuring the actor.

"I honestly feel better than I’ve felt in my whole life. As I’m aging, I’m feeling like I am more and more comfortable in my skin and my posture and my body," Harris said. "I feel like I’m in the best shape of my life, but in more practical terms — as opposed to ‘gym body’ for others."

The "How I Met Your Mother" star also shared his outlook on life, noting that it is "acquiring chapters in a book," adding that he doesn't want his life to be a "pamphlet."

"I want it to be a tome. I enjoy chapters," he said. "I enjoy lines on my face. I enjoy wrinkles around my eyes. It came about because I smile a lot, so I don’t feel the need to age down at the moment."

Harris got married to David Burtka in 2014. The couple shares twin kids - Harper Grace, 11, and Gideon Scott, 11. Harris celebrated their 18th anniversary on Instagram in April by sharing a sweet photo.

On the work front, Harris will be next seen in the TV series, "Uncoupled," which is under post-production. He will also appear in a movie, titled "Anita."

Neil Patrick Harris
Neil Patrick Harris was not nominated for his role as Count Olaf at the 2017 Emmys. Pictured: Harris speaks onstage during Neil Patrick Harris: In Conversation in the AT&T Studio during the 2017 Vulture Festival at Milk Studios on May 21, 2017 in New York. Getty Images/Bryan Bedder