'How I Met Your Mother' has reportedly been renewed for a ninth season.

While the future of the sitcom was thought to be in doubt after Jason Segal said he wanted to focus on his movie career, he and co-stars Josh Radnor, Cobie Smulders, Neil Patrick Harris and Alyson Hannigan have signed on for a final season, according to Deadline.

CBS has been open about its desire to have a ninth season, with entertainment president Nina Tassler saying: ''We want the show to come back next year. We're not there yet in terms of resolving the situation, but we're pretty optimistic.''

Recently, Josh admitted he was unsure about the show's future but promised fans the main storyline would be wrapped up even if it ended after season eight.

He said: ''They really need to figure it out because the writers need to know. They're the pressing issue right now because they have to figure out if they're wrapping up the show at the end of season eight or season nine. (We've) just very recently been approached about that and we really can't say either way right now.''