STOCKHOLM — Swedish prosecutors have indicted a woman who in July staged a standoff to prevent the deportation of a rejected asylum seeker to Afghanistan by refusing to take her seat on the flight.

The woman, Elin Ersson, was a volunteer with an organization that fights the forced return of Afghan asylum seekers whose applications have been rejected. Ms. Ersson, 21, filmed herself in a standoff on July 23 with the cabin crew of a Turkish Airlines flight at Landvetter Airport in Gothenburg.

The indictment, issued on Friday in a district court in Gothenburg, said Ms. Ersson had violated the Swedish aviation act by remaining standing when the plane was set to take off. Crimes against the act carry fines or a prison sentence of up to six months on conviction.

“She did so with the intention of preventing the plane from departing,” a prosecutor, James von Reis, told the Swedish newspaper Svenska Dagbladet on Friday.

Eventually, the captain ordered Ms. Ersson and a 50-year-old Afghan man she had been trying to protect off the plane, and it was able to take off. The man was eventually deported.

Ms. Ersson’s lawyer, Thomas Fridh, said that her actions on the plane had not violated any laws. “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,” Mr. Fridh said in an email on Saturday.

He said that the Swedish aviation act applied only to actions in the air, not on the ground.

In an emailed statement on Saturday, Ms. Ersson said that she would continue to fight against forced repatriation of refugees to Afghanistan.

“To send someone there is in practice sending someone to their death,” she wrote. “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.”

The police in Gothenburg said that a preliminary investigation was started after people filed complaints when they saw the video.

Mr. von Reis, the prosecutor, said her actions had “caused a lot of confusion, irritation and worry inside the plane. Some of the passengers were quite upset about this,” according to the Swedish newspaper JP.

But her actions also drew praise.

Anne Ramberg, director general of the of the Swedish Bar Association, wrote on her blog in July that Ms. Ersson “showed courage and stood up for something that she and many others believe is an urgent issue in Sweden.”

The man was an Afghan asylum seeker seated in the rear of the Turkish Airlines flight and accompanied by officials assigned to transport him back to Kabul, Afghanistan.

In a 15-minute act of defiance, livestreamed via her mobile phone, Ms. Ersson refused to sit, delaying the departure, though impatient passengers and crew members yelled at her.

She calmly responded: “I am doing what I can to save a person’s life.”

The man was eventually taken off the plane.

Nordic countries have experienced a diminished tolerance for migrants, making it harder for Afghans to successfully gain asylum. This year, Sweden has accepted a historic low number of asylum requests for Afghan adults and minors, migration authorities say.