A stunt by a Swedish activist to stop the deportation of an Afghan refugee has been widely hailed on social media.

University student Elin Ersson had booked the same flight as the Afghan and refused to sit down unless he was taken off the plane on Monday.

She streamed her protest live on Facebook, showing a tense standoff with other passengers and airline crew.

Reactions have been largely supportive of her action, although some people are accusing her of grandstanding.

The video has since been widely shared and received almost two million views.

Ms Ersson explains to the other passengers and the viewers of Facebook that she does not agree with Swedish deportation policy, which classifies Afghanistan as a safe country and sends rejected asylum seekers back.

She says Afghanistan was a country where the man "will most likely get killed" and explains that "I am doing what I can to save a person's life".

"As long as a person is standing up the pilot cannot take off. All I want to do is stop the deportation and then I will comply with the rules here."

The video shows how first the airline crew and then several other passengers urge her to sit down and to stop filming.

As the standoff continues, she says several people in the plane also stood up, some in support, others to see what was going on.

Her actions eventually had both her and the 52-year-old Afghan being taken off the plane.

Legal trouble for activist?

The man had been escorted on board by the Swedish Prison and Probation Service.

"Asylum cases are decided by the immigration office," press officer Ulf Mossberg told the BBC. "If they make a decision that someone will be deported they hand the person to the national border police. The police then can ask us to perform that transportation.

"What happened on this flight was that the pilot of the plane decided that our personnel and the Afghan man were not allowed to fulfil the flight."

Media reports suggest the refugee is likely to be deported later and that the activist might face legal consequences over her actions. Plane passengers are obliged to follow the captain's orders.

The deportation of migrants remains controversial across Europe.

In recent years the continent has seen an influx of migrants from Africa, the Middle East and Afghanistan.

Boats carrying people across the Mediterranean are facing increasing opposition and find it harder to find ports that allow them to dock.

Earlier this month, the German interior minister came under pressure to quit after noting in a joking tone that 69 Afghans had been deported on his 69th birthday.

One of the group took his own life after being sent back.