Irvin Kershner, who directed the Star Wars sequel "The Empire Strikes Back" and the James Bond film "Never Say Never Again," has died at age 87.

Kershner died Saturday at his Los Angeles home following a 3-year battle with lung cancer, said longtime friend and Hollywood publicist Dick Guttman.

Kershner already had made a number of well-received movies when he was hired by George Lucas to direct "Empire," which was the second produced but fifth in the "Star Wars" chronology.

The 1980 production was a darker story than the original. In it, hero Luke Skywalker loses a hand and learns that villain Darth Vader is his father. The movie initially got mixed reviews but has gone on to become one of the most critically praised.

Kershner told Vanity Fair in October that he tried to give the sequel more depth than the original.

"When I finally accepted the assignment, I knew that it was going to be a dark film, with more depth to the characters than in the first film," he said. "It took a few years for the critics to catch up with the film and to see it as a fairy tale rather than a comic book."

Kershner said he had only one sharp disagreement with Lucas. The script originally called for the heroine, Princess Leia, to tell space pilot Han Solo "I love you" and for him to reply "I love you, too."

"I shot the line and it just didn't seem right for the character of Han Solo," Kershner said.

Instead, actor Harrison Ford improvised the reply: "I know."

Lucas wanted the original line but after test previews agreed to leave in Ford's reply, which has gone on to be one of the best-known lines in the series.

"The world has lost a great director and one of the most genuine people I've had the pleasure of knowing," Lucas said in a statement, adding that he considered Kershner to be a mentor.

Lucas said he didn't want to direct the "Star Wars" sequel.

"I needed someone I could trust, someone I really admired and whose work had maturity and humor. That was Kersh all over," Lucas said. "I didn't want 'Empire' to turn into just another sequel, another episode in a series of space adventures. I was trying to build something, and I knew Kersh was the guy to help me do it. He brought so much to the table. I am truly grateful to him."

The Philadelphia-born Kershner studied music, painting and photography before turning to film. He studied at the University of Southern California film school and in the 1950s made U.S. government documentaries in Greece, Iran and Turkey.

He was a director and cameraman for a television documentary series called "Confidential File" in Los Angeles before getting his first movie break in 1958 when Roger Corman helped finance his first feature, "Stakeout on Dope Street," that Kershner wrote and produced with colleague Andrew Fenady, Guttman said.

He went on to direct a number of noted features in the 1960s and 1970s, including "A Fine Madness" with Sean Connery, Joanne Woodward and Jean Seberg, "The Flim-Flam Man" with George C. Scott, "Loving" with George Segal and Eva Marie Saint, and "The Eyes of Laura Mars" with Faye Dunaway.

The 1976 television movie "Raid on Entebbe" earned him an Emmy nomination for direction.

Besides "Empire," his big-budget work included the 1983 James Bond movie "Never Say Never Again" with Connery and "Robocop 2" in 1990.

"We all enjoyed knowing Kersh, learning from him and admired his creative spirit and indomitable will," Francis Ford Coppola said in a statement. "It was always exciting to talk with him about all aspects of cinema and life. He will most certainly be missed."

"He had the most incredible spirit, an exuberance for life. Always working, always thinking, always writing, amazingly gifted and forever curious," said Barbra Streisand, a friend who worked with him on 1972's "Up the Sandbox."

Kershner also was an occasional actor. He played the priest Zebedee in Martin Scorsese's "The Last Temptation of Christ."

In recent years, Kershner taught screenwriting at the University of Southern California while continuing to produce, write and create still photographs, Guttman said.

He is survived by two sons, David Kershner and Dana Kershner.

"My father never really retired. He had a powerful drive to create - whether it be through film, photography, or writing," David Kershner said.

At the time of his death, he was working on a documentary about his friend, writer Ray Bradbury, and a musical called "Djinn" about the friendship between a Jewish immigrant and an Arab sheik in Palestine before it became Israel, his son said.

David Kershner said his father told him in September: "You have to throw yourself into things. There is no second way. Passion gives you energy."