James Horner holds two Oscars at the 1998 Academy Awards ceremony after winning for best original song and best original dramatic score for his work on “Titanic.” (Blake Sell/Reuters)

James Horner, an Oscar-winning film composer who wrote the music for the two highest-grossing movies in history, “Avatar” and “Titanic,” and whose score from “Titanic” became the top-selling movie soundtrack of all time, died June 22 when his single-engine airplane crashed in Southern California. He was 61.

The Gorfaine/Schwartz Agency, which represented Mr. Horner, said in a statement that he was the sole occupant of a private aircraft that went down in flames in a remote region of the Los Padres National Forest, about 60 miles north of Santa Barbara. Mr. Horner was a licensed pilot.

Once dubbed “the Mozart of movies” by a British newspaper, Mr. Horner had been one of Hollywood’s most prolific composers since 1980, writing the scores of more than 100 films. He worked with such well-known directors as Steven Spielberg, Ron Howard, Oliver Stone, Norman Jewison and Edward Zwick.

Mr. Horner was nominated for 10 Academy Awards during his career and won two for his work on “Titanic,” the 1997 blockbuster directed by James Cameron.

With a 3 1/2 -hour running time, “Titanic” required an exceptionally long musical score, which Mr. Horner composed with choral singing and elements of folk music over layered orchestration. He won the Oscar for best original dramatic score.

Composer James Horner at the premiere of James Cameron’s "Avatar" in 2009. (Kevin Winter/Getty Images)

“Ideally, the music shouldn’t be noticed at all,” Mr. Horner told Time magazine in 1995. “It should just manipulate the hell out of an audience. Music shoves the emotions around, and it has to be done skillfully and elegantly.”

Almost as an afterthought, he composed a theme song, “My Heart Will Go On,” which was sung by Celine Dion over the film’s closing credits. With lyrics by Will Jennings, “My Heart Will Go On” won the Oscar for best original song and went on to be a smash hit. At the 1999 Grammy Awards, “My Heart Will Go On” won for record of the year, song of the year and best song written for a motion picture.

Mr. Horner’s “Titanic” soundtrack, meanwhile, spent 16 consecutive weeks as the No. 1 album on the Billboard pop charts in 1998. It sold 27 million copies worldwide, making it the best-selling film soundtrack in history.

After his success on “Titanic,” Mr. Horner was sometimes highlighted in the advertising of other films: “Music by Academy Award-winning composer James Horner.”

He first collaborated with Cameron in 1986 on the science-fiction thriller “Aliens,” writing an Oscar-nominated score in only 10 days. The director and composer worked together again in 2009 on “Avatar,” a futuristic thriller that supplanted “Titanic” as the top-grossing film in history and earned Mr. Horner another Oscar nomination.

Mr. Horner also received Academy Award nominations for such varied films as “Field of Dreams” (1989), “Apollo 13” (1995), “Braveheart” (1995), “A Beautiful Mind” (2001) and “House of Sand and Fog” (2003).

As a composer, Mr. Horner was known for mixing unexpected sounds, such as pan flutes or children’s voices, with full orchestras. In “Apollo 13,” he used the sound of the flute to lend a sense of otherwordly fragility to the drama of astronauts trapped in space.

In “Braveheart,” starring Mel Gibson as a medieval Scottish warrior, Mr. Horner underscored mass scenes of hand-to-hand combat with thundering drums.

“Those big battlefield scenes were all done with big Japanese ceremonial drums, low Tibetan droning tubes and Swiss alphorns to create this sound,” Mr. Horner told the Los Angeles Times in 1999. “So it ends up being not literally Scotland or not literally Africa. It’s an impression of it. It’s like painting.”

Mr. Horner first gained wide notice in Hollywood with his score for “Star Trek II: The Wrath of Khan” (1982), in which he created a separate musical theme for each of the major characters. He also included the original theme from the 1960s television show “Star Trek” in the movie’s fanfare.

His rousing score for “Glory,” a 1989 film about a black Civil War regiment starring Denzel Washington, won a Grammy for best instrumental composition for a motion picture.

In a different vein, he composed the delicate, childlike “Somewhere Out There” with songwriters Barry Mann and Cynthia Weil for the 1986 animated film “An American Tail.” It won Grammy Awards for song of the year and best song written for a motion picture.

“When you marry the music to the scene, somehow it transcends what it was,” Mr. Horner said in a 1997 interview with CBS News. “And it’s the two of them — the two art forms combined that do it. And it’s something that I just am always sort of in awe of.”

James Roy Horner was born Aug. 14, 1953, in Los Angeles. His Czech-born father, Harry Horner, was a Hollywood production designer who won Academy Awards for art direction for “The Heiress” (1949) and “The Hustler” (1961).

Mr. Horner spent much of his youth in London, where he studied at the Royal Academy of Music. In the 1970s, he received a bachelor’s degree in composition from the University of Southern California and a master’s degree in music theory and composition from the University of California at Los Angeles.

His early goal was to be a serious composer, but as he struggled to get his music performed, he began to work with young filmmakers through the American Film Institute. In the early 1980s, working for a studio founded by B-movie maestro Roger Corman, Mr. Horner wrote scores for such forgettable fare as “Humanoids from the Deep.”

“I fell in love with film,” he told the Los Angeles Times in 1999. “Here was the perfect medium for me. I could be a chameleon. . . . Movies gave me an excuse to do whatever I wanted so long as it was pertinent to the film.”

Survivors include his wife, the former Sarah Nelson of Calabasas, Calif.; two daughters; and a brother.

In 2006, Mr. Horner wrote a new musical theme for the “CBS Evening News” when Katie Couric became the program’s anchor. (The theme was changed in 2011.)

He continued to compose occasional symphonic works, including a double concerto for violin and cello in 2014 and a concerto for four French horns, which had its debut performance this year by the London Philharmonic Orchestra.

Mr. Horner wrote the score for “The Amazing Spider-Man” (2012), and several of his projects are awaiting release, including “Southpaw,” a boxing film with Jake Gyllenhaal and Rachel McAdams.

The secret to composing music for film, Mr. Horner told the Los Angeles Times in 2009, “is to make sure at every turn of the film it’s something the audience can feel with their heart. When we lose a character, when somebody wins, when somebody loses, when someone disappears — at all times I’m keeping track, constantly, of what the heart is supposed to be feeling.”