Image copyright BBC / Getty Images Image caption Jodie Whittaker as the Doctor (left) and Rosa Parks (right)

Sci-Fi series Doctor Who has been praised for its portrayal of historical racism and Rosa Parks in Sunday night's episode.

Fans of the series were taken on a trip through time and space with the 13th Doctor (played by Jodie Whittaker) to 1950s Alabama.

However, it was an America where black and white people were kept separate by law.

In the episode the Doctor and her companions meet civil rights activist Rosa Parks and watch as she refuses to give her bus seat up for white passengers.

It was created by series writer Chris Chibnall and author of Noughts and Crosses, Malorie Blackman.

'Hard episode to watch'

People commented on Twitter that the writers hadn't undermined the legacy of Rosa Parks.

One of those tweeting was former Doctor Who actress Georgia Tennant. She's also married to a previous Doctor in real life (guess who).

How the characters experienced 1950s America

Throughout the episode, the characters had very frank and open discussions about racism.

Image caption Characters Ryan and Yaz went back in time and experienced racism

Ryan Sinclair (played by Tosin Cole) is threatened and told that he could be lynched for helping a white woman who had dropped her glove.

Yaz Khan (played by Mandip Gill) is constantly referred to as a 'Mexican' throughout - despite being Asian.

Author Malorie Blackman was the Children's Laureate from 2013 to 2015 and is the first black writer for Doctor Who.

A lot of people will remember Malorie from the 2001 book, Noughts and Crosses.

The book is set in an alternative world where two friends of different races deal with their challenges of racism.

Who was Rosa Parks?

You may have probably heard the name in school from your history lessons - but how much do you know about the activist?

Image copyright Getty Images Image caption Rosa Parks being fingerprinted after not giving up her seat up on a bus

On 1 December 1955 Rosa Parks was arrested for refusing to give her seat up for white passengers in Montgomery, Alabama.

Black travellers were required to pay at the front of the bus, leave it, walk to the back of the vehicle and then re-enter.

They also had to give up their seats for white customers if the bus started filling up.

This was allowed because of the segregation laws that were in place (now known as Jim Crow laws).

Image copyright Getty Images Image caption The bus Rosa Parks was arrested on has since been preserved

After her arrest, members of the African-American community organised a boycott of the buses.

The Montgomery Bus Boycott lasted for just over a year and has since become part of African-American history.

Rosa's protest eventually led to racial segregation on buses ending - a decision that was met with opposition and violence.

It was also responsible for helping bring Martin Luther King to the forefront of the civil rights movement.

As a result of her protest, Rosa and her husband Raymond both lost their jobs.

They left Montgomery and moved to Detroit where Rosa became a secretary and receptionist for a US politician.

Not just buses

Although Rosa Parks is most famous for her protest, her life of activism was so much more.

Image copyright Getty Images Image caption Rosa Parks was a member of her local National Association for the Advancement of Colored People for 12 years

She and her husband joined the NAACP- a civil rights organisation which still exists today.

Whilst at the National Association for the Advancement of Colored People she started working towards abolishing segregation and discrimination.

Rosa Parks has been honoured by many different organisations and was awarded the Congressional Gold Medal in 1999, one of the the highest civilian awards in the USA.

Image caption Actress Vinette Robinson played Rosa Parks in the episode

The actress who played Rosa was delighted by the social media reaction.

Rosa Parks died on 24 October 2005.

She lived to be 92 and saw America change beyond recognition.

Her bus protest happened 63 years ago, and will always be remembered as an iconic moment in the history of the civil rights movement.

Follow Newsbeat on Instagram, Facebook and Twitter.

Listen to Newsbeat live at 12:45 and 17:45 every weekday on BBC Radio 1 and 1Xtra - if you miss us you can listen back here.