Cobie Smulders says posing topless helped her open up about her battle with ovarian cancer.
The 34-year-old former "How I Met Your Mother" star penned a candid essay in Lenny Letter, revealing that her May 2015 cover shoot for Women's Health magazine inspired her to think about what her body had endured just a few years before.
"I was standing in front of a camera lens holding my breasts, all while trying to appear not sexy but confident, not flirtatious but gleamingly positive," wrote Smulders, who was diagnosed with ovarian cancer at 25, during the third season of "HIMYM."
More Pop Culture videos
‘Brady Bunch’ stars have a very Brady reunion, honor Florence Henderson
George Clooney skips awards ceremony because twins may arrive soon
Angelina Jolie: I wish my mom were here to help me raise my kids
‘Atomic Blonde,’ Katy Perry’s album: Summer entertainment preview
"It all made me start thinking about this body that I’m in. And what it has been through. And suddenly this bizarre invitation became an opportunity to share some insight from my experience of being diagnosed with, receiving treatment for, and eventually learning to cure my cancer."
Smulders, who portrays Marvel Comics superhero Maria Hill in the "Avengers" films, posed for the photo just six weeks after giving birth to her second daughter.
Though the actress, who's married to former "Saturday Night Live" star Taran Killam, was making television audiences laugh each week, behind the scenes cancer had taken "total mental, physical, and emotional" hold of her.
"Just when your ovaries should be brimming with youthful follicles, cancerous cells overtook mine, threatening to end my fertility and potentially my life," she wrote.
More Health videos
TODAY gets life-saving training for World CPR Challenge
Rossen Reports update: Are you swimming in germ-filled public pools and water parks?
Drop 10 TODAY: 4 tips to stay motivated from Joy Bauer
Summer Shape-Up finale: Tips for staying motivated and fit all season long
She frantically tried meditation, acupuncture, yoga and anything else that might help heal her body. After two terrifying years and "multple surgeries," Smulders got a clean bill of health.
"Thankfully, gratefully, cancer did not get the best of me," wrote Smulders. "The best of me now lives on in my two little women, baby girls I was lucky enough to be able to make with my own body."
But that fateful cover shoot made the actress realize it's her "duty" to talk to other women about ovarian cancer.
"(I)t feels so empowering to open up this dialogue and learn from each other," she wrote.
Read Smulders' full essay at Lenny Letter.