A Chinese court says a street vendor has been executed after being convicted of killing two security officials, prompting a social media outcry.

Xia Junfeng stabbed the two security officials after being detained for hawking in Shenyang, Liaoning province, in 2009, Chinese media say.

He argued that he had acted in self-defence after the men attacked him.

China's urban enforcers are unpopular with the public, and Xia's case attracted widespread sympathy.

"Criminal Xia Junfeng, who is guilty of intentional homicide, was executed on 25 September in Shenyang city, Liaoning province, in accordance with the law," the Shenyang Intermediate Court wrote on its verified microblog on Wednesday.

The confirmation that Xia Junfeng's death penalty had been carried out has been met with a storm of outrage on the Chinese internet, the BBC's John Sudworth in Shanghai reports.

Xia Junfeng's case quickly became one of the most discussed topics on Sina Weibo, one of China's Twitter-like microblogs.

Who are the chengguan? Urban law enforcers tasked with enforcing ''non-criminal administrative regulations'' such as traffic, environment and sanitation rules

Chengguan operate separately from the police

They are employed by the Urban Administrative and Law Enforcement Bureaux of their individual cities

Critics call them "violent government thugs"

Reports that a disabled street vendor was beaten to death by chengguan in 2011 sparked riots in China's Guizhou province

There are thousands of chengguan in at least 656 cities across China, Human Rights Watch says

"This is a father who killed to retain his dignity," one weibo user wrote.

Another post read: "Justice dies in front of our eyes."

Some internet users have made unfavourable comparisons between his case and that of Gu Kailai, the well-connected wife of the disgraced politician Bo Xilai, our correspondent adds.

Gu was convicted of murdering British businessman Neil Heywood, but was given a suspended death sentence.

Earlier on Wednesday, Xia's wife, Zhang Jin, wrote that she was travelling to the detention centre to see Xia for the last time.

"Xia Junfeng asked them to let us take a family photo, but was rejected," she wrote in a post that was widely shared. "Why are they so cruel, why?"

China's chengguan, or Urban Management Law Enforcement force, support the police in tackling low-level crime in cities.

Chengguan members are unpopular with the public after a series of high-profile violent incidents.

In July, six enforcers were detained after a fruit seller in Hunan died when hit on the head during an altercation.

In July 2011, the death of a disabled street vendor who was reportedly beaten by local law enforcers sparked a riot in Guizhou province.