A CPR class at a Red Cross turned out to be a lifesaver.

Ryan Reynolds is a real life superhero.

The dad of two posted a photo of himself Monday on Instagram after attending a CPR course, revealing that he once saved his nephew’s life because of the knowledge he gained.

“Years ago, I took a CPR course thru the Red Cross,” he wrote in the caption. “And holy s—, I ended up saving my nephew’s life because I knew what to do! True story!”

“Yesterday I took a refresher course — focusing on infant and toddler CPR,” he continued. “It takes only a few hours and it’s also kinda, sorta fun. Thank you to Dan from Viva First Aid for the lesson. And thank you to these two helpful yet lifeless dolls whose vacant ocular cavities will haunt me until end times.”

Reynolds, 40, has two daughters he shares with his wife and actress Blake Lively, 2-year-old daughter James and a 9-month-old daughter.

The Shallows actress, 29, posted a similar Instagram post on Monday, urging parents to take CPR courses, especially if they had small children.

“I can’t recommend this enough, I took a CPR class with a focus on babies and toddlers,” Lively wrote. “Google ‘infant CPR class near me’ and you’ll see lots of listings.”

She added, “For those of you who haven’t done it, you will love it. It’s so helpful by giving you knowledge, tools, and some peace of mind.”

Lively and Reynolds are often candid about parenthood — and all the ups and downs that come with it.

FROM PEN: Emily Maynard Johnson Admits She Was Ashamed to Stop Breastfeeding Her Third Son Early

In an interview with Good Morning America earlier this year, Reynolds joked about trying to travel with his young daughters, admitting, “I’ve always had empathy for parents, especially flying. I remember before I had kids, I was always like, ‘God, that’s hard.'”

“Because you can see they’re sweating and they’re nervous because their kids are yelling and everyone’s mad at them,” said Reynolds, adding, “I’m the same way.”

Still, the actor has said he wouldn’t change a thing. He told eTalk last December, “It’s the best thing. It’s the best thing that could ever happen to you.”