Kate Hudson has revealed how nervous she felt about her latest film role as a white socialite who accuses a black man of rape in the 1940s.

The actress said there were many things about the role that gave her pause, but she felt it was important to tell the story.

Hudson stars in Marshall, about the real life trial of chauffeur Joseph Spell in 1941, who was accused of the rape and attempted murder of Connecticut socialite Eleanor Strubing.

It was an early case fought by the first black Supreme Court justice, Thurgood Marshall, played by Black Panther star Chadwick Boseman, who was a 30-year-old lawyer when he defended Spell, played by Sterling K Brown.

Asked if she was concerned about playing a woman who falsely accuses someone of rape, Hudson told the Press Association: “There were so many things about this character that gave me pause.

“It was something that I had a very hard time relating to in any way. And then when Reggie (Hudlin, the director) talked about the movie he wanted to make and the importance of it it sort of took me outside of my own moral and ethical codes of how I handle my life and put me into this time and how important it is to tell these stories.

2017 amfAR Inspiration Gala Los AngelesKate Hudson (Jordan Strauss/AP)

“As an actor sometimes you have to kind of take your own personal beliefs and you never really set them aside but, when the cameras are rolling, you have to believe in what that character is.

“That was really challenging and, as an actor, challenge is something that is really enticing.

“I was being asked to play an incredibly complex character that is trapped and lonely and makes a horrible decision that she can’t extricate herself from in any way and those kinds of complexities are interesting to tackle.”

Hudson said the issues of racial divide felt all too relevant in today’s America.

She said: “It is so interesting how relevant it is right now, and something that was in 1941 is still as relevant today as it was then.

“These things you would think would have been something that people learned from and instead we are still seeing history repeat itself.

“I think it’s just important to be a part of movies that make people continue to have the dialogue. It would be amazing if movies could actually inspire younger generations to fight like Thurgood Marshall.”

She added: “Sometimes when you’re looking at material you don’t how much is true and you don’t know how much is stretching to tell the narrative in a way that makes sense in two hours so as an actor you come in with your ideas.

“You say ‘I don’t know if my character would say this’ or ‘I think this is actually stretching it a little’ and we all had these moments with this case where we were dumbfounded that these things were actually said, they were actually happening.

“It was kind of an amazing history lesson. We must never forget our history, all of it.”

Marshall opens in UK cinemas on October 20.