More than eight months before David Oyelowo went into production on “Selma,” the movie that led to so many accolades for his performance as the Rev. Martin Luther King Jr., he filmed “Nightingale,” an 85-minute solo tour de force.

Now on HBO, “Nightingale” centers on a man who could not be more different than King - a man alone, at war with the world, isolated and out of his mind.

“This was a role I had to play,” Oyelowo insists.

With standout roles in films including “Lincoln” and “Lee Daniels’ ‘The Butler,’” Oyelowo has established an impressive acting career that reached a milestone with “Selma” and his acclaimed portrayal of King as the humble but determined leader who became a national figure in the quest for racial equality.

In “Nightingale,” Oyelowo unearths whole new aspects of his actor’s psyche. He rages, he jokes, he sings, he dances and he plots in the role of Peter Snowden, a disturbed war veteran living in a modest home with his mother. When she opposes his insistence to invite a beloved war colleague over for dinner, he snaps and commits a horrific act that has already taken place when the film opens. Though things at first glance seem normal, it becomes evident from his behavior - talking to himself and to an unknown audience via computer, that something is terribly wrong.

On “Selma,” the British-born actor had the luxury of working with a sizable budget, a veteran ensemble and thousands of extras. “Nightingale” was much more stressful. Oyelowo moved away from his house, isolated himself from family and friends, changed his diet, lived in effect as a hermit and basically stayed in character as Snowden for the duration of the shoot.

“Essentially I’m always looking for ways to scare and challenge myself,” Oyelowo says during a recent visit to Los Angeles. “I look for things that take me outside my comfort zone, and all of that would be taking place in this piece.”

His commitment to exploring Snowden’s troubled psyche was so enveloping that even director Elliott Lester says he barely saw the real Oyelowo during the filming at a rented home in Tarzana, Calif.

“I don’t know David Oyelowo, the actor, on a movie set, but I do know Peter Snowden,” Lester says. “We did one read-through at the house, and I said goodbye to David. The next day he came on the set wearing a boxing robe with his head covered, and there was Peter Snowden.”

Oyelowo admits that the process was a bit of an ordeal: “I didn’t come out of character - I effectively didn’t shake him. I moved out - I didn’t want that around my wife and kids. I was solitary. I would take food from the set - I didn’t want to go into shops, didn’t want to talk to anyone. That enabled me to tell the truth.”

It’s a difficult truth. First-time screenwriter Frederick Mensch, a web developer who lives outside Chicago, was partially inspired to write “Nightingale” by the account of a middle-aged man in the neighborhood who went berserk one day and killed his mother.

“I used to walk my dogs by the house,” Mensch says, “and it started me thinking about what goes on behind closed doors.”

The Snowden character first turned up in another of his screenplays. “He just took hold of my imagination,” the writer says. Driven to create a script with minimal cinematic elements, Mensch began developing a story around Snowden and his solitary life.

He wrapped his story in the theme of desperation. “What it feels like to want something so much, but you can’t have it - that’s what the film is about,” he says. “In relationships, that can lead us to make bad decisions and lose perspective.”

Lester, whose credits include the Jason Statham cop drama “Blitz,” got ahold of the script and was mesmerized: “I knew I had to make this,” he says.

Oyelowo was also drawn in by the script: “The unique nature and the feel of the story worked on the page - it read and looked like a film, even though it was only one character,” he says, “As an actor who gets scripts that more often or not feel derivative, this didn’t feel like any of that. That’s the main reason I couldn’t shake it as an opportunity.”

As they prepared, Lester was specific in his direction of his star: “I gave him freedom. He could take any chance he wanted to take and know it would be OK. As long as he was taking the risks, as long as he was pushing the edges, I could give him the freedom to shine.”

Oyelowo is very proud of “Nightingale,” though it’s also a bit difficult for him to watch: “I don’t recognize anything of myself in it. I was so entirely invested in being that guy. This was really giving myself over to something.”

The film premiered at the Los Angeles Film Festival last year. Plan B, the production company headed by Brad Pitt, became involved with the project after Pitt watched it at Oyelowo’s urging, and signed on as a producer. (Plan B was also a producer of “Selma.”)

It is giving audiences their first chance to see the actor since he was bypassed for a lead actor Oscar nomination for “Selma.” Oyelowo at the time was vocal about what he felt was a lack of awards recognition for the film, issuing some sharp criticisms of the Academy of Motion Picture Arts and Sciences that questioned its attitudes about movies dealing with race. Several months later, the sting of what many feel was a snub is still a delicate and sensitive one for him.

Summarizing his perspective on the controversy, Oyelowo says, “The reality is that good movies are not just for awards season. They’re for life.”