Hard to imagine now, but before "Titanic" was released two decades ago (on December 19, 1997), much of Hollywood expected the then-most expensive film ever made to be a colossal failure. It would sink at the box office like -- well, you know.

Even James Cameron had his doubts that the film would work, fearing that blending an intimate-scale teenage romance with an epic-scale disaster movie would be like "chocolate syrup on a cheeseburger."

You know how the story ends, though. "Titanic" became the biggest hit in Hollywood history (until Cameron's own "Avatar" surpassed it 12 years later), won a record number of Oscars (including Best Picture), turned Leonardo DiCaprio into a box office titan, made Kate Winslet a globally-beloved actress, and crowned writer/director Cameron as King of the World.

You've probably seen the movie so many times that that damn Celine Dion song is still stuck in your head today. Even so, you may not know about the film's tempestuous production history that spawned all that pre-release pessimism. Here's how it all went down.

1. Cameron's interest in the Titanic began a decade before the movie's release, when he saw the National Geographic documentary by Robert Ballard, the leader of the team that found the Titanic wreckage on the Atlantic Ocean floor. Still, the "Terminator" director had never made a romance or a period drama, and he had a hard time selling 20th Century Fox on his idea.

2. Nonetheless, he got the studio to pony up $2 million to send him on an expedition to the shipwreck site. 3. Armed with a submarine-mount camera designed by his aerospace-engineer brother, Cameron captured Titanic footage like none other yet obtained -- chandeliers, piles of furniture, and staterooms with intact woodwork and decor. The footage sealed the deal.

4. For Rose, Cameron considered such young actresses as Gwyneth Paltrow, Claire Danes, and Gabrielle Anwar, but Kate Winslet lobbied him hard for the part with daily notes and phone calls. One missive was a card that read "From Your Rose," accompanied by a single rose. Another time, she called him in his car and said, "You don't understand! I am Rose. I don't know why you're even seeing someone else." Eventually, the director agreed.

5. For Jack, the filmmakers initially wanted Matthew McConaughey. But then they decided they needed a Jack who looked about 20, ruling out the 26-year-old "A Time to Kill" star.

6. They also considered Chris O'Donnell, Jared Leto, and the then-unknown Billy Crudup. But when Leonardo DiCaprio screen tested with Winslet, both the director and the actress thought he was so good that Winslet told Cameron that, even if he didn't hire her, he should hire the "Basketball Diaries" actor.

7. Actually, it was DiCaprio who needed to be sold on the filmmakers behind what was to be his first mainstream, big-budget Hollywood movie. He kept trying to suggest changes to Jack to make the part more interesting to play, until Cameron balked and said, "Look, I'm not going to make this guy brooding and neurotic. I'm not going to give him a tic and a limp and all the things you want." DiCaprio relented and signed on.

8. The most remarkable bit of casting may have been the older Rose. Gloria Stuart had been a promising Hollywood starlet in the 1930s, acting in such films as 'The Invisible Man" and "Rebecca of Sunnybrook Farm." She'd quit the movies in the 1940s and had worked for decades as a visual artist. She'd begun acting again in her sixties in small character parts, but she was all but retired by the time Cameron cast her, at age 85, to play the centenarian Rose.

9. Cameron had considered trying to lure her contemporary, original "King Kong" star Fay Wray, out of retirement to play Rose before selecting Stuart. Her Oscar-nominated comeback made her famous for the rest of her life. Stuart died in 2010 at age 100, about the same age as her "Titanic" character.

10. Cameron's drive for accuracy included no fewer than 12 dives to the wreck site during the production, on occasion bringing set and costume designers along. To recreate the Titanic, he obtained the original blueprints. His production designer discovered that the company that had manufactured the ship's carpets was still in business and commissioned the firm to duplicate them for the movie.

11. In the scene where Jack sketches a nude Rose, the actors' visible nervousness was real. After all, it was the first scene DiCaprio and Winslet shot together. The portrait was actually drawn by Cameron.

12. Three weeks into the shoot, members of the cast and crew suffered a weird bout of food poisoning, tripping on lobster chowder that had been laced with PCP. Who spiked the soup with angel dust? That's one of the enduring mysteries of "Titanic."

13. Cameron got Fox to build a water tank in Rosarito, Mexico (above), one that could hold 17 million gallons of water. In the tank, Cameron staged much of the action aboard a 770-foot-long scale model, about 90 percent the size of the actual Titanic.

14. Of course, many scenes recreating the ship -- particularly during the sinking -- were achieved with digital trickery, though there were only about 500 effects shots in the film, a modest number by the standard of today's CGI extravaganzas.

15. During the final plunge of the ship's stern, where hapless passengers and crew are shown tumbling and bouncing around the deck, three stuntmen suffered broken bones. That's not unusual for an action-heavy production as big as "Titanic," but reports of the injuries, along with the director's hot-tempered defiance of Fox's efforts to cut expensive scenes, led to rumors in Hollywood that Cameron and his movie were out of control.

16. Still, Cameron did save the production millions by giving up his director's fee. He also gave up his percentage of the profit, a gesture Fox found hollow because it didn't expect the film to go into the black. Cameron did, however, keep his seven-figure fee for writing the screenplay.

17. The film's running time is three hours and 15 minutes, or about 35 minutes longer than it took the actual Titanic to sink.

18. "Titanic" cost $200 million to make, a figure that was double the amount originally budgeted, an unprecedented amount to spend shooting a movie back in 1997, and a sum so high that 20th Century Fox had to bring Paramount aboard as a financing partner.

19. That cost (nearly 27 times the $7.5 million spent to build the actual ship in 1912), reports of turmoil from the set, and production delays that pushed the release from July to Christmas 1997, led to all the ominous buzz about the film's abysmal prospects. Even Fox studio chief Peter Chernin told the Los Angeles Times he thought the studio would be lucky just to break even.

20. Of course, the film ended up with an unprecedented box office haul as well, some $601 million in North America and $1.5 billion abroad. Even so, Hollywood bean-counters at the time didn't think Cameron's seafaring success would launch a wave of similarly costly blockbusters. As one producer told the Times, "All people did for a year in this town was sweat 'Titanic.' I think 'Titanic's' cost will make people look more carefully at the cost of a movie." Today, with studios routinely spending $200 to $300 million on franchise installments, such optimism about Hollywood's fiscal discipline sounds wistfully naive.

21. "Titanic" tied some Oscar records. It shares with "All About Eve" the record for the most nominations (14) and with fellow Best Picture winners "Ben-Hur" and "The Lord of the Rings: The Return of the King" the record for the most trophies won (11).

22. The ceremony became famous as the one where Best Director winner Cameron quoted his own screenplay and shouted, "I'm the king of the world!" "Titanic" also won for editing, cinematography, production design, costumes, sound, sound editing, visual effects, James Horner's instrumental score, and the song "My Heart Will Go On."

23. At 86, Stuart was the oldest actor ever nominated for Oscar. She grumbled that she might have beaten "L.A. Confidential" star Kim Basinger for Best Supporting Actress, had not Cameron left so much of her performance on the cutting-room floor. Winslet was also nominated, for Best Actress, but lost to Helen Hunt ("As Good As It Gets"). DiCaprio wasn't even nominated.

24. A decade after "Titanic," Winslet and DiCaprio reunited to play an unhappily married couple in "Revolutionary Road," which neither critics nor audiences much cared for. Today, they're still pals, and Winslet says they still crack each other up by quoting "Titanic" dialogue to each other.

25. According to the 2017 National Geographic documentary "Titanic: 20 Years Later with James Cameron," the obsessive filmmaker has made 33 dives to the wreck site in the two decades since the film's release, investigating to see what he got right on screen and what he didn't. His biggest mistake may have been his depiction of the way the stern went down after the ship broke in half. Using a bathtub-size scale model designed by naval engineers and his own special effects team -- and sinking the model dozens of times -- Cameron now believes the stern rose vertically only once, not twice.

26. Cameron says he also regrets not being more sensitive to the descendants of the survivors, particularly those of crewman William Murdoch (Ewan Stewart), whom "Titanic" depicted as a gun-wielding villain, without any basis in historical fact.