Ryan Gosling stars as the driver in the film “Drive.” (Richard Foreman, Jr./SMPSP)

In 2009, when Ryan Gosling reached out to Nicolas Winding Refn to direct “Drive,” a taut, quietly mesmerizing thriller about a getaway car driver, he found the Danish director in one of Hollywood’s most notorious neighborhoods: Development Hell.

Refn had been trying to convince Harrison Ford that his character should die in the CIA thriller they were doing. To make matters worse, the 40-year-old filmmaker, who lives in Copenhagen with his wife and two daughters, was suffering from a vicious case of flu, and first met Gosling while “completely stoned” on medication, finally asking the actor — after an awkwardly quiet dinner — to drive him back to his hotel in Santa Monica.

“It was like a blind date gone terribly wrong,” Refn recalled over an espresso during a recent visit to Washington. “And then REO Speedwagon’s ‘I Can’t Fight This Feeling Anymore’ starts to play. I’m a huge ’80s fan, and here I was, really ill, high as a kite, completely out of balance. I missed my wife. I missed my kids. Harrison Ford wouldn’t die. In X amount of months I was going to be broke. Everything was just a disaster. And I started to cry.”

Then, he said, an idea seized him. “I screamed in Ryan’s face, ‘I got it!’ I know what ‘Drive’ is! It’s going to be about a man who drives around at night listening to pop music, because that’s his emotional relief.’ And Ryan said, ‘I’m in.’ ”

For Gosling, the moment came as a revelation. After reading the “Drive” script, which is based on a novel by James Sallis, he says he “wished that this film could be about a guy who just drove around listening to music and not about stunts and driving fast, but just the spell that a car can put you under. Suddenly he’s next to me crying and singing. . . . I thought, ‘How is it he and I are both having the same dream?’ We can’t have a conversation, and yet we’re carrying the same dream. What I love is that this film would never have gotten made had REO Speedwagon not come on the radio. I would have dropped him off and that would have been that.”

Director Nicolas Winding Refn, in town to promote his newest film called “Drive.” (Bill O'Leary/WASHINGTON POST)

Gosling’s character doesn’t exactly listen to pop music in “Drive,” which brought Refn the best director award at this year’s Cannes Film Festival. He’s more of a techno fan, with the occasional baseball game thrown in for good measure. Nameless in the movie (he’s simply called Driver in the credits), he joins a long list of laconic, isolated protagonists — played over the years by Robert De Niro, Steve McQueen, Ryan O’Neal and Lee Marvin — who prowl urban streets in a permanent state of wordless alienation. In “Drive,” Driver’s self-sufficient life takes a hard left when he meets his pretty new neighbor, Irene (Carey Mulligan).

Refn comes from an accomplished artistic family: His mother, Vibeke, is a renowned photographer, and his father, Anders, is Lars von Trier’s editor. When his parents divorced, he moved with his mother and stepfather to Manhattan, where from age 8 to age 17 he steeped himself in the American pop culture his cineaste parents considered “fascist.” At 14, he saw “The Texas Chainsaw Massacre” and decided: “I want to make that.”

After returning to Copenhagen, he secured a prized spot at the Danish Film School but soon dropped out to make his first feature, “Pusher,” a crime drama that became a cult hit. Almost immediately, he became known as the wild child of Danish cinema, a mythos he found himself trying to live up to. “You’re young, and it’s rock-and-roll and drugs and all those things, and you’re very careless. . . .I was making very nihilistic, very self-indulgent films that were just going to destroy me personally.”

In 2003, he made “Fear X,” with John Turturro, a disaster that wound up with him owing a huge amount of money. “Here I was, in my late twenties, and I owed a million dollars,” he said. “Career-wise, I was just one of those European filmmakers that flew high and crashed hard.” Around this time, his first daughter was born, “and my whole life turned around. It made me very conscious of . . the repercussions of what you do, [and the effect it] has on people.”

After making two sequels to “Pusher” in order to get out of debt, Refn made the films that brought him to the attention of Hollywood: “Bronson,” his kinetic, masterfully stylized portrait of real-life British serial killer Michael Peterson (a.k.a. Charlie Bronson), which featured a breakout performance by Tom Hardy; and “Valhalla Rising,” a medieval tale starring Mads Mikkelsen as a one-eyed Viking with a penchant for visceral displays of godlike strength.

Bob Berney, whose company FilmDistrict is releasing “Drive,” says that observing Refn at this stage of his career “reminds me of when we first released ‘Memento,’ ” referring to the pivotal film by Chris Nolan, who went on to direct the “Batman” movies, as well as “Inception.” Berney sees the same type of toggling for Refn. “My sense is that he will [strike] a balance between Hollywood films and personal or European-backed projects,” Berney said. “But he’s going to have to learn that, until you’re Chris Nolan, you’re not the auteur in Hollywood. That's a big learning experience to go through, but I think he can.”

For Refn, “Drive” brings an end to a trilogy of films about men undergoing profound transformations. He’ll next work with Gosling on “Only God Forgives,” from his own script, and a remake of “Logan’s Run.” Then he’s done with guys for a while. “I’m trying to step away from making films about violent men,” he said. “I’m not a guy-guy. I like women and . . . I love feminism. I’ve gone to the extreme of saying to Carey Mulligan, whatever happens, the next film I do after [working] with Ryan, is going to be a film about women, and you will play the lead. That’s our deal.”