Neil Patrick Harris is the latest addition to Seth MacFarlane's Western comedy, A Million Ways To Die In The West.
The How I Met Your Mother funnyman has signed on to the star-studded ensemble movie, which already includes Charlize Theron and Liam Neeson among the cast, reported Collider.
Amanda Seyfried, Sarah Silverman and Giovanni Ribisi also have roles in the film, which marks Seth's second time in the director's chair.
Seth, who co-wrote the script with his Ted writers Alec Sulkin and Wellesley Wild, will direct, produce and star as a cowardly sheep farmer whose girlfriend (Amanda) leaves him for another man.
He turns to a "mysterious and beautiful" married stranger - played by Charlize - to help him find his courage, and has to put his new-found bravery to the test when her outlaw husband (Liam) rides back into town seeking revenge.
A Million Ways To Die In The West is set for release in May 2014.
Neil, who is best known for playing womaniser Barney Stinson in the US sitcom and his cameo roles in the Harold And Kumar comedies, will next be seen in The Smurfs 2.