CBS’ “How I Met Your Dad” has announced its first major casting, tapping Greta Gerwig to star in the “How I Met Your Mother” spinoff.

Gerwig will play Sally, a female Peter Pan who is on the verge of breaking up with her husband after less than a year of marriage.

In addition to starring in “How I Met Your Dad,” Gerwig will receive a producer credit. Should the comedy pilot get picked up to series by CBS, Gerwig is also expected to write for the show. The indie darling has been active as a writer on the film side as well.

20th Century Fox TV is producing “How I Met Your Dad,” a spinoff of “HIMYM” with a brand new story and group of characters. Emily Spivey, Carter Bays and Craig Thomas penned the pilot and are exec producing. Pamela Fryman will helm the pilot and also exec produce.

Casting arrives on the heels of Gerwig’s Golden Globe nomination for her performance in “Frances Ha,” an indie dramedy that Gerwig co-wrote with Noah Baumbach. Her feature film credits include “To Rome with Love,” “No Strings Attached” and “Greenberg,” and Gerwig recently wrapped “The Humbling” opposite Al Pacino. She is repped by UTA and Management 360.