Image copyright Weibo Image caption Xian Guolin, from Gansu province, used up all his savings to open a noodle store

In Shanghai, where you are never far from a good lunch, one man has faced anger and even death threats, by breaking a "treaty" and opening a noodle shop too close to an existing one, as Yvette Tan reports.

Xian Guolin used up all his savings and mortgaged his house to open Alilan Beef Noodles on the busy Nanjing Road.

It sells the popular "lamian" hand-pulled noodles, served in a hot broth with a shaved beef topping.

But within hours of opening the shop, he was facing protests from other noodle-makers demanding he shut down.

"The first few days there were almost no customers to be seen," he said on his Weibo page.

A 'harmonious' arrangement?

Image copyright Getty Images Image caption Most beef noodle restaurants in China are owned by ethnically Hui people, according to Chinese media

Like most lamian makers, Mr Xian is a Hui Muslim originally from Gansu, in northwest China.

The protesters said Mr Xian had violated the Shaanxi-Gansu-Ningxia treaty, a decades-old agreement between Hui people which prohibits anyone from opening a beef noodle restaurant within 400m of an existing one.

The document says this is to promote a "harmonious and stable" noodle market, and that those who do not abide by it will have to face the consequences and accept any financial losses.

Ma Jinglong, a protest organiser and Hui Muslim who owns two nearby beef restaurants, told news outlet The Sixth Tone that the treaty "doesn't have any legal standing" but that most Muslim restaurateurs observe it anyway.

"I have a big family to support. If one restaurant ignores the treaty, the rules will be broken, and more restaurants will follow suit," he said.

Image copyright Weibo Image caption Business at the noodle shop soon picked up after netizens caught on to what was happening

When Xian refused to close, the store was surrounded by around 100 people, threatening staff members and stopping customers from coming in.

The same group continued to stand in front of the restaurant for weeks, despite police intervention, he says, costing him 4,500 yuan ($670; £510) in lost business every day.

"Some held the door and stopped customers from coming in, while others hurled abuse at me and the waiters," said Mr Xian. "They threatened that my relatives would be killed unless I closed the restaurant."

He was offered 300,000 yuan to close the shop, in which he had originally invested 1.5m yuan, but refused.

#BeefNoodleGate

Mr Xian used micro-blogging site Weibo to document the siege, where the hashtag "#BeefNoodleGate" became a trending topic and attracted support high-profile users.

It has now had more than 400 million comments, and sparked discussions among netizens if the implementation of the treaty was legal.

"This is happening less than one kilometer away from the city government. What can I say?" asked one user.

Image copyright Weibo Image caption The Weibo page quickly gained gained 400 million comments and 90,000 discussions.

Reflecting the ethnic dimension of the row, one Weibo user asked: "Is this Shanghai or is this Islam territory?"

However, some users were positive, with one netizen pointing out that the store had earned itself some free publicity.

Shanghai residents soon caught on, with many visiting the store to show their support.

Mr Xian posted on Weibo that people had come from as far as Hangzhou and Nanjing - a few hours away by train - to support him, while others posted photos of themselves and the food at the restaurant, calling for others to join them.

Image copyright Weibo Image caption Customers took pictures of themselves and posted them on Weibo, encouraging other users to come

Image copyright Weibo Image caption Groups of netizens flocked down to the restaurant in support of Xian

After 20 days, authorities moved to resolve the situation, culminating in Mr Xian removing the word "beef" from the restaurant name, and agreeing to drop the halal logo, meaning it was technically not in competition with the other Muslim-run outlets.

Image copyright Weibo Image caption The sign on Alilan restaurant now shows an evident blank in between the words "Alilan" and "Noodles"

Image copyright Weibo Image caption The words "beef" had to be taken out from the restaurant's signboard

He posted on Weibo afterwards that business was "back to normal", adding that some customers jokingly asked if the beef would be gone from their bowls since it was no longer on the signs.

He thanked netizens and "countless kind folks" for supporting the restaurant.

However, some pointed out that the actions of the store-owners threatening Mr Xian had gone unpunished, adding that the "noodle gang" had won.