Cobie Smulders has revealed she was diagnosed with ovarian cancer when she was 25.

The Canadian actress, who reprises her role as S.H.I.E.L.D agent Maria Hill in Avengers: Age Of Ultron, told Women’s Health US that she was in the midst of shooting the third series of How I Met Your Mother when she received the news.

Cobie Smulders (Clint Spaulding/AP)
Cobie Smulders (Clint Spaulding/AP)

“I had tumours on both ovaries, and the cancer had spread into my lymph nodes and surrounding tissues,” she revealed.

Cobie didn’t take time off work to be treated, juggling her schedule on the hit show – in which she played Robin Scherbatsky – with attending her hospital appointments.

“It took multiple surgeries over the course of two years to remove the cancerous tissue,” she said.

Cobie, who strips off for the front cover of the magazine’s May issue, said she still feels the impact of battling cancer.

“I don’t think I’ll ever feel like I’m cancer-free,” she said. “Now that I’m five years out, I’m trying to think of it as a positive thing and what can I learn from it. And if I can create more awareness, I’ll do it.”

Cobie Smulders and Taran Killam (Jordan Strauss/Invision/AP)
Cobie Smulders and Taran Killam (Jordan Strauss/Invision)

The 33-year-old star has since given birth to two children with husband Taran Killam – five-year-old daughter Shaelyn, five, and a son born in January.