LOS ANGELES — A Hollywood writer and director has announced the death of his wife and longtime collaborator, Gloria Katz, who co-wrote "American Graffiti" and helped give Princess Leia her power in "Star Wars." She was 76.

Willard Huyck told the Hollywood Reporter that Katz died on Sunday, their 49th wedding anniversary, at Cedars-Sinai Medical Center in Los Angeles after battling ovarian cancer.

The couple shared an Oscar nomination with director George Lucas for "American Graffiti" and secretly doctored his script for "Star Wars." The Reporter quoted Katz as saying they shaped Carrie Fisher's Leia into someone who "can take command," not "just a beautiful woman that schlepped along to be saved."

They also wrote the screenplay for Steven Spielberg's "Indiana Jones and the Temple of Doom," which Lucas produced, and later co-wrote "Lucky Lady," ''Messiah of Evil," ''French Postcards," ''Best Defense," ''Howard the Duck," and "Radioland Murders."

Born in Los Angeles on Oct. 25, 1942, Katz majored in English at the University of California, Berkeley, then earned a masters in film at UCLA. In 1969, she married Huyck, a college friend of Lucas at the University of Southern California.

The Reporter quoted Katz as saying in a 2017 interview that Lucas wanted her husband "to write about cruising for American Graffiti, and I sort of came with the package."

She said Lucas had "a lot of reservations" about his "Star Wars" script as filming was about to begin.

Mark Hamill, Carrie Fisher and Harrison Ford on the set of "Star Wars: Episode IV - A New Hope." Sunset Boulevard / Corbis via Getty Images file

"He said, 'Polish it — write anything you want and then I'll go over it and see what I need,'" she said. "George didn't want anyone to know we worked on the script, so we were in a cone of silence."

Katz said she and Huyck tried to add as much humor as possible and wrote about 30 percent of the film's dialogue.

Katz was on the board of the Writers Guild, was an adviser at the Academy Museum of Motion Pictures, set to open next year, and served as chair of the Photographic Arts Council Los Angeles.

Survivors include their daughter, Rebecca.