Hilary Duff is about to become legen … wait for it … dary.

The former teen idol and "Younger" star has gotten the unlikely role in a gender-swapped sequel to "How I Met Your Mother" on Hulu.

Called "How I Met Your Father," the show will follow Sophie (Duff, 33) reminiscing to her son about how she met his father and recounting her friend group’s dating antics back in 2021, (as told from a vantage point in the future). 

The former show, which ran on CBS from 2005 to 2015, had a similar format, with Bob Saget’s voice narrating a look back at Ted Mosby’s (Josh Radnor) past dating romps and friend group, including womanizing Barney (Neil Patrick Harris), ambitious Robin (Cobie Smulders) and couple-goals duo Marshall (Jason Segel) and Lily (Alyson Hannigan). The hit series was often innovative with its structure, jumping around in time and weaving in long-running jokes.

HILARY DUFF GIVES BIRTH TO THIRD CHILD, HER SECOND WITH HUSBAND MATTHEW KOMA

Hilary Duff is starring in a sequel to 'How I Met Your Mother' on Hulu. (Photo by Richard Shotwell/Invision/AP, File)

The new series will be written by Isaac Aptaker and Elizabeth Berger, both of whom wrote and produced for "This Is Us," as well as "Love, Simon" and its spinoff, "Love, Victor."

"As a huge fan of ‘How I Met Your Mother,’ I’m honored and even a little nervous that Carter and Craig would trust me with the sequel of their baby," Duff said in Hulu’s press release announcing the show. "Isaac and Elizabeth are brilliant, and I can’t wait to work alongside them and all of their genius."

HILARY DUFF REVEALS THE 'LIZZIE MCGUIRE' REVIVAL IS NOT HAPPENING AFTER FAILING TO AGREE WITH DISNEY

"Just fangirling over here getting to join the Hulu Originals and 20th families. I realize these are big shoes to fill and I’m excited to slip my 6 ½’s in there!"

Much like "Game of Thrones" the series finale of "How I Met Your Mother" landed like a lead balloon among most audience members because — spoiler alert — the writers thought it would be a great idea to throw in the final twist of the mother (Cristin Milioti) dying, while Ted ends up with Robin. 

NEW YORK, NY - MAY 19: Actress Hilary Duff attends the Vulture Festival Presented By AT&T - Milk Studios, Day 1 at Milk Studios on May 19, 2018 in New York City. (Photo by Dia Dipasupil/Getty Images for Vulture Festival)

Actress Hilary Duff will star in 'How I Met Your Father.' (Getty)

CLICK HERE TO SIGN UP FOR OUR ENTERTAINMENT NEWSLETTER

Apparently, it was more important to be "surprising" than to live up to the show’s central premise that’s in its title.

"How I Met Your Father" will be produced by Duff and "How I Met Your Mother" creators Carter Bays and Craig Thomas. It does not yet have an announced premiere date. 

CLICK HERE TO GET THE FOX NEWS APP

This article originally appeared in the New York Post.