Justin Timberlake is to reunite with ex-girlfriend Cameron Diaz.

The singer-turned-actor - who dated the actress for almost four years until their split in 2007 - has been cast in the lead role in new comedy film 'Bad Teacher' alongside Cameron.

In the Columbia Pictures film, Justin will play a substitute teacher who is seduced by Cameron's character, a junior high school teacher bitter after being dumped by her sugar daddy.

The 29-year-old pop star - who has since found love with 'Valentine's Day' actress Jessica Biel - will act alongside Molly Shannon, Eric Stonestree, John Michael Higgins and Jason Segel in the movie.

Doug Belgrad, co-president of Columbia Pictures, told Access Hollywood: "With Justin, Molly and Eric, joining Cameron, Jason, Lucy and the rest of this dream comedy cast, we couldn't be more excited about this movie. We love what we've seen of Justin's performance in David Fincher's 'The Social Network' and he is a perfect match for this role."

This will be the first lead role for Justin, who has had numerous supporting roles in movies such as 'Alpha Dog' and 'The Love Guru'.

The former lovers will start shooting the film, which was written by the 'Office' team of Lee Eisenberg and Gene Stupnitsky, in Los Angeles in April.