BEIJING — In an acknowledgment of the problem of domestic abuse in China, a court on Friday suspended the death sentence of a battered woman who had killed her husband, a case that drew international attention and a petition from hundreds of Chinese lawyers and feminists urging the court to reconsider.

The ruling, by the Sichuan Higher People’s Court, upheld the murder conviction against the woman, Li Yan, 44, but acknowledged, for the first time, that she had been the victim of domestic violence. The suspension means that after two years of good behavior, the sentence will be commuted to life in prison. Later, it may be reduced further.

“A death sentence was not justified in this case, given the domestic violence Li suffered,” said Chi Susheng, a lawyer in Qiqihar in China’s far northeast and a former delegate to the National People’s Congress, who signed the petition.

Women in China who killed abusive spouses were once routinely executed, but as the scale of domestic violence began to emerge in the early 2000s — officials say one in four marriages is affected, activists say one in three — lengthy prison sentences became the norm instead. Over time, the sentences have grown lighter.

On Friday, the courtroom in Sichuan Province erupted in angry shoving and shouting when Judge Huang Tianyong announced the decision. Relatives of Ms. Li’s husband, Tan Yong, who have demanded her execution, threw shoes and papers at Ms. Li and her lawyer, shouting “Tramp!” and “Traitor!” according to Xiao Meili, an observer in the courtroom.

Mr. Tan was killed in the couple’s home in rural Anyue County, where they ran a noodle stall, after what Ms. Li described as more than a year of abuse.

He grabbed her hair and hit her head against the wall, stubbed out cigarettes on her face and legs, and locked her outside on cold nights, Ms. Li told the court at her retrial in November. Often after beating her, he abused her sexually, she said.

She sought help from the police, a hospital, the local justice department and the local branch of the All-China Women’s Federation, a government organization tasked with defending women’s rights. All, according to her lawyers, advised her to just “bear it.”

Then, on the night of Nov. 3, 2010, she said, Mr. Tan struck her with an air rifle in a drunken rage, threatening to kill her. She grabbed the weapon and slammed the barrel against his head twice, killing him, she told the police at the time.

She cut off his head and put it in a pressure cooker, saying she feared his angry eyes even in death, then chopped up his body and boiled some of the pieces before reporting the death to a neighbor.

She was sentenced to death by the Ziyang Intermediate People’s Court, a sentence effectively commuted on Friday.

Last year, the Supreme People’s Court in Beijing ordered Ms. Li’s case retried because of problems with the evidence.

In March, the court issued an opinion explaining the concept of “justified defense” in domestic violence cases. The opinion made spousal abuse a mitigating factor in crimes committed in self-defense, and it established new rules providing privacy protection for victims and allowing protection orders against abusers.

The new approach dovetails with China’s attempts to increase public respect for the judiciary, which is widely seen as corrupt and unfair, and coincides with an effort to curb the number of executions, estimated to be as high as 12,000 in 2002.

In 2006, judges in the country began to advocate a policy of “kill fewer, kill cautiously.” Beijing accepted the policy, and in 2007, the court began reviewing every death penalty case.

Dui Hua, a human rights group in San Francisco, estimates that the number of people put to death in China fell to 2,400 in 2013, still more than in all other countries combined. The precise number is not known, as the government considers it a state secret.

Susan Finder, a legal scholar based in Hong Kong and the author of the Supreme People’s Court Monitor blog, said, “It seems the Supreme People’s Court is making progress in reducing use of the death penalty.”

But progress has been mixed, she said.

According to the new rules, said Feng Yuan, a leading feminist, Ms. Li “should have received a more just sentence.”

“There is certain progress here,” she said. “There is a significant difference between the death penalty and suspended death. But over all, it’s getting better on paper more than in reality, and this case shows that we need to see how these new rules can be implemented.”

Lawyers say that courts also consider “social stability” in handing down harsh punishments and that it may have played a role in this case.

“The courts are still under a lot of pressure to hand down sentences that won’t get anyone upset,” said Joshua Rosenzweig, an expert on human rights in China who lectures at the Chinese University of Hong Kong. “One of the things they’re trying to do is to satisfy the victim’s family, so they get the victim’s family to accept the verdict so they won’t petition and keep this case alive.”

At her retrial in November, Ms. Li held up her right hand to show the judge a truncated middle finger, cut off in a fight with her husband, she said. “I did not kill him on purpose,” she said quietly.

She begged for forgiveness from Mr. Tan’s family. “I apologize to Mr. Tan’s family,” she said, “and if they are willing, will pay my respects to them.”

Vanessa Piao contributed research.

A version of this article appears in print on , on Page A3 of the New York edition with the headline: Battered Woman Is Spared Execution in China. Order Reprints | Today’s Paper | Subscribe