Skylar Astin has been cast in the upcoming fourth and final season of "Crazy Ex-Girlfriend" as former co-lead character Greg.

The "Pitch Perfect" star steps into the role after Greg was first portrayed by Santino Fontana up until Season 2.

The character was written off the show after Fontana dropped out of the series.

"It will be a great statement on how our perception of people changes. Greg is a barometer of how people's perceptions changes. It'll have been two years since Rebecca's seen him," creator and star Rachel Bloom who appears as Rebecca, said Monday at the 2018 Television Critics Association press tour.

"Crazy Ex-Girlfriend" will be returning with its fourth and final season on Oct. 12 on The CW.

The series, Bloom and co-creator Aline Brosh have said, was always envisioned as lasting four seasons.

Bloom has previously announced that Season 4 will feature the song "Cell Block Tango" from the film "Chicago" and actor Patton Oswalt returning as security guard Castleman.

Photo credit: Skylar Astin / Instagram