Movies

Idris Elba’s transformation from drug dealer to ‘Mandela’

When Idris Elba first heard about his latest film role, he thought it was a joke.

“My agent is a prankster, so I was like, ‘C’mon, man. Stop bullsh - - - ing me. I haven’t got time for that.’ ”

But the offer was for real.

Director Justin Chadwick (“The Other Boleyn Girl”) wanted Elba — best known stateside for “The Wire” — to portray Nelson Mandela in a sprawling biopic spanning nearly the entire life of the South African activist, from boyhood to prison to being elected president of his nation.

Idris Elba (left, with Naomie Harris as Winnie Mandela) follows in the footsteps of Terrence Howard and Morgan Freeman as Nelson Mandela.Keith bernstein/AP

It was a role that Denzel Washington had circled for years before opting out. (Actors ranging from Terrence Howard to Sidney Poitier to Morgan Freeman have played the politician over the years.) Elba, 41, admits that accepting the lead part in “Mandela: Long Walk to Freedom,” out Friday, was possibly the riskiest choice of his career.

“It would seem that I wasn’t completely right to play him,” he tells The Post. “I don’t look like him, and one could argue that I was too young and not experienced enough. If I had an Oscar, people would say, ‘Yes, perhaps — perhaps — you can play him.’ I’m essentially a television actor that had done some films, and this is a big trophy role to play.”

At least one viewer approves of Elba’s casting: Nelson Mandela himself. The 95-year-old screened footage from the end of the film, when Elba, wearing old-man make-up, is walking up a hillside near his village.

“Mandela looked at the shirt and the way [I] was walking and said, ‘Is that me? Did I do that? How did you get me up there?’ ” says Elba.

The world leader wasn’t the only one fooled.

“After watching early cuts, people said, ‘I love how you got Mandela to fill in there at the end,’ ” Elba recalls.

To become Mandela, the actor went Method and spent a night in Robben Island prison, where Mandela was locked away for 18 years for conspiracy to overthrow the segregated government.

“I remember the guy [at the still-working prison] was very nervous about locking me in. I was in there by myself and it was pretty harrowing,” Elba says. “I had to really calm the f - - - down. I did have a telephone [and], if I really wanted to get out, I could. But as soon as the guy left, I realized there was no signal.”

Elba, who was born and raised in and around London, had an advantage when it came to tackling Mandela’s accent: The actor’s parents are immigrants from West Africa. (Still, he worked on intonation for three months with two South African dialect coaches.)

As a young man, Elba scored several parts on British TV series, but at one point was so poor that he was living in a van.

Scoring the role of Baltimore drug dealer Stringer Bell on HBO’s “The Wire” turned Elba’s life around.

Idris Elba (left) and Riaad Moosa in “Mandela: Long Walk to Freedom.”

“I don’t get tired of being associated with ‘The Wire,’ ” he says. “I love when people call me ‘Stringer!’ Well, I won’t say I love it, but . . .it’s part of my history.”

The series, which ran from 2002 to 2008, became one of the most acclaimed American television shows ever and led to a string of films for Elba, including “Thor,” “Prometheus” and last summer’s “Pacific Rim.” Most recently, he’s starred as a detective on the acclaimed BBC program “Luther.” (But Elba shoots down the rumors that he’s in the running to play James Bond.)

Elba is not big on opening up about his private life, but he still resides in London, and is said to be dating makeup artist Naiyana Garth. He’s been married twice and has an 11-year-old daughter.

“I’ve always dreamt of a career that always keeps an audience guessing what will happen next,” Elba says. “That’s what I want to leave as my legacy: ‘You never knew what he was going to do next, but whatever it was, it was interesting.’ ”

One thing that might surprise fans is his music. Elba has released several rap-, R&B- and reggae-tinged tracks under the name Driis. He’s currently working on an album inspired by “Mandela” that’s due out next year. The tracks were recorded in Johannesburg over two weeks with African and English musicians.

“I have two studios. I have lots of instruments — I can tinker about [enough] to tell a musician what to play,” he says. “After making this album, I vowed I’d play every instrument. I’ve started the drums and I play half-decent.”

Elba’s already got one thing an artist needs to make it in the British music world: a beef with Liam Gallagher. The two reportedly clashed at a February awards show after the former Oasis frontman made fun of Elba’s knit ski hat. The actor responded by tousling Gallagher’s moptop.

Elba now downplays the occurrence as “a big laugh.” But still: We always knew Gallager was crazy, but messing with Stringer/Luther? Now that’s certifiable.