Hollywood star Will Smith had the producer of his latest film holding his head in anguish on Tuesday after the actor gave away the ending of I Am Legend.

Speaking at a Tokyo news conference, Smith inadvertently revealed the plot, prompting co-producer and co-screenwriter Akiva Goldsman to shout: Don't give away the ending!

Goldsman then pretended to be surprised, but it was all too late, and press handlers asked all present to keep the ending a secret, so as not to spoil it for viewers.

Smith plays a virologist fighting a man-made virus in I Am Legend, the film adaptation of Richard Matheson's 1954 novel of the same title.

The movie premieres simultaneously in the United States and Japan on December 14.

(Reporting by Toshi Maeda; writing by George Nishiyama; editing by Roger Crabb)