A Swedish student activist who prevented a Turkish Airlines flight from taking off to stop an Afghan man from being deported has been indicted by state prosecutors.

Elin Ersson, 22, purchased a ticket from Gothenburg to Istanbul to stop a man being sent back from Sweden by disrupting the July 23 flight.

Elin broadcast her protest live on Facebook in which she refused to sit down - recording disgruntled passengers and airline staff ordering her to take her seat.

The video went viral, generating millions of views worldwide.

Eventually Ersson, the Afghan man and his assigned security were removed from the flight.

In an act of civil disobedience, a Swedish student activist, Elin Ersson (above), took out her phone and streamed a 14-minute video where she walked about the plane explaining the man 'will most likely get killed' if he's deported. The incident took place in Gothenburg on July 23

The Afghan man was eventually deported.

Ersson was indicted in Gothenburg district court on Friday, The New York Times reported.

She stands accused of violating Sweden's aviation act by continuing to stand just as the plane was about to depart.

If convicted, she faces up to six months in prison and fines.

Ersson's lawyer said his client is innocent.

'During the entire action she was prepared to follow the orders of the captain on board, and she left the plane as soon as the pilot decided that she should do so,' the lawyer, Thomas Fridh, said.

Fridh said that the aviation act only applies to actions taken whilst the plane is in the air, not on the ground.

Despite being criminally charged, Ersson vowed to continue to fight the government's deportation policies.

'To send someone there [to Afghanistan] is in practice sending someone to their death,' she told the Times.

'As someone who is against the death penalty, it is only right to stand up for those who are faced with being deported to a land in war.'

James von Reis, the prosecutor handling the case, said Ersson 'caused a lot of confusion, irritation and worry inside the plane.

'Some of the passengers were quite upset about this.'

Speaking to The Guardian after the footage, which showed she was eventually backed by fellow passengers, she said: 'I was so caught in the moment that I didn't really realize that everyone was looking at me.

'My focus was all on stopping a deportation to Afghanistan.'

The student who works with refugees believes the man she attempted to keep in Sweden was taken back to his war-torn country of origin via Stockholm.

But his family has had no news on his whereabouts.

She said: 'This is how deportations in Sweden work. The people involved know nothing and they are not allowed to reach out to their lawyers or family.

'My ultimate goal is to end deportations to Afghanistan.'

Originally, her plan was to stop an asylum seeker who she thought was on the plane.

But upon boarding she realized that there was a different Afghan asylum seeker who was also being deported.

The man was accompanied by Swedish government officials who were expected to accompany the refugee to Kabul.

The footage, now viewed by millions of people, shows cabin crew and other passengers asking her to sit down, which she insists she will do as soon as the man is let go.

At one point, a disgruntled fellow passenger tries to seize her phone, but she asks him: 'What is more important, a life, or your time?'

'All I want to do is stop the deportation and then I will comply with the rules here.

'This is all perfectly legal and I have not committed a crime.'

Eventually the 50-year-old man, not the girl's original target, is let off the plane and his deportation is prevented.

Ersson, 22, a student at Gotheburg University, kept the Turkish airlines flight from Gotenborg in Sweden to Istanbul grounded until the 52-year-old Afghan man, who was due to be deported, was escorted off the plane

Though Ersson is initially jeered by impatient passengers wishing to take off, by the end of the clip many in the plane sympathize with her cause.

At that point, other passengers joined her protest and many applauded when the man is led off the plane.

In 2015 alone 163,000 refugees traveled to Sweden for refuge - 63,000 registered as unaccompanied minors.

Trainee social worker, and refugee volunteer Ersson said she could not stand the thought of another person being returned 'to be killed'.

She said to The Guardian: 'People there are not sure of any safety. They don't know if they're going to live another day.

'As I've been working and meeting people from Afghanistan and heard their stories, I've been more and more in the belief that no one should be deported to Afghanistan because it's not a safe place.

'The way that we are treating refugees right now, I think that we can do better, especially in a rich country like Sweden.'

Eventually, people on the plane took her side and Miss Ersson became emotional.

First, a man stood up behind her and said he supported her - before an entire football team at the back of the plane did the same thing.

She said: 'It felt good, when the Turkish guy started talking to me and making sure that I knew I wasn't alone.'

Some Twitter users have even branded her a 'hero'.

Swedish authorities claim the activist could face up to six months in prison for refusing to obey police orders

One person said: 'Thank you for your stand, for your courage, compassion and hope'.

Another added: 'This is what a superhero looks like'.

Ersson's protest highlights the domestic opposition to the Swedish government's tough line on asylum.

In January, Kabul was hit by a Taliban terrorist attack which killed more than 100 people and wounded at least 235.

At the time, Sweden put a temporary brake on deportations to Afghanistan but these have since resumed and the government considers the country safe for failed asylum seekers.

The response on Twitter has been mostly positive, and the video which Ersson livestreamed on Facebook has racked up 2 million views

Sweden has now toughened its refugee acceptance conditions and asylum applications have correspondingly dropped.

Ersson is one of many Swedes who feel that their government's approach has been too harsh.

'I am trying to change my country's rules, I don't like them,' she said. 'It is not right to send people to hell.'