BEIJING — He was a poor man selling sausages and chicken from an unlicensed food cart in hope of earning enough money to send his talented young son to an art school in the capital.

Outside a market in northeast China on a spring day, two municipal officers, members of a notoriously brutal force known as chengguan, confiscated Xia Junfeng's cooking equipment and took him in for questioning. Xia said it quickly turned into a beating.

Soon, both officers were dead, stabbed with a small knife Xia kept in his pocket for slicing sausages.

On Wednesday, more than four years since the incident in Shenyang, after lengthy appeals and heavy publicity that turned him into a symbol of repression for many Chinese, Xia was executed. China's microblogs were flooded with outrage.

On one popular site, Sina.com, Xia's name was the most searched of the day, and 2.8 million people posted messages, almost all supporting him.

Many contrasted his case with that of Gu Kailai, the wife of ex-Politburo member Bo Xilai, whose sensational corruption trial wrapped up Sunday with the imposition of a life sentence. Gu, a lawyer, was convicted last year of premeditated murder for poisoning a British businessman. She was given a suspended death sentence, the equivalent of life in prison.

"Gu Kailai was a member of the privileged class, who knew what crime she was committing," wrote one outraged critic in a comment later expunged by censors. "Xia Junfeng was struggling at the bottom of society to survive. His death is an injustice. There is only tyranny."

"Hero Xia, rest in peace. Your anti-repression spirit will continue to inspire the repressed," wrote another. "Your name will live in history."

Xia's wife said she and her mother-in-law were given 30 minutes' notice Wednesday morning that they would be allowed a brief visit with her 37-year-old husband before he was executed.

"He was calm. He didn't cry. He just kept telling us that he was defending himself," Zhang Jing said in a telephone interview Wednesday.

"I feel in a very confused state right now. Very bad," Zhang said. "My mother-in-law is worse. She was crying and screaming and banging her head against the floor."

Xia was selling food from a tricycle outside a market in Shenyang in May 2009 when the two municipal officers confronted him. In an interrogation room, one of them attacked him, he said during his trial.

"He began to beat me as soon as I entered the room, his fists pounding my head and ears," Xia said. "As I tried to run outside, I came face to face with [another officer]. Right away, he grabbed my collar to stop me. He also struck me with his fist ... and kicked at my thighs."

Xia said he put his hand down to protect his groin and then "my hand came in contact with my knife."

The killing in Shenyang catapulted Xia to national celebrity. After his arrest, his wife became an activist, publicizing the case over her own microblog. The family's fame was spread in part by their son, Xia Jianqiang, now 13, a prize-winning artist whose paintings of his father have been widely viewed on the Internet.

The family has said that Xia was trying to earn money to send the boy to art school in Beijing.

After three years of appeals that went up to China's supreme court, Xia's defense was rejected. The Shenyang province intermediate court has said Xia stabbed the officers several times, beyond any need for self-defense, and that there was no evidence he had been beaten, making him guilty of "intentional homicide."

"The crime he committed was heinous. The method he used was extremely cruel, and the results serious. He should be punished to the full extent of the law," the court wrote in an opinion released Wednesday.

The chengguan, a notch below regular police officers, have a reputation across China for overstepping their authority and roughing up street vendors. Every year, there are headlines about incidents in which street vendors re beaten to death.

In July, authorities in Hunan province announced that the family of a watermelon vendor who died after a confrontation with the officers had received nearly $150,000 in compensation.

Xia's lawyers documented 16 such deaths going back to 2001. They said one of the officers killed by Xia had a record of abuse, and had the year before broken the arm of a woman selling umbrellas without a license, according to court filings.

China executes more people each year than all other countries combined, about 3,000 in 2012, according to the San Francisco-based Dui Hua Foundation, a human rights organization. But the number is down significantly from a decade ago, when it was estimated at 12,000 per year.

"China has committed itself to reducing the number of executions," said John Kamm, Dui Hua's founder. "One hopes that a case like this one is one that will get more people questioning the death penalty."

barbara.demick@latimes.com