They took down everyone's passport or ID number, and then came the very public on-the-spot urine tests. I was asked who I worked for. This was a new breed of drug raid, writes Stephen McDonell.

The Chinese capital is in the midst of a major crackdown on illegal drug use. And the people of Beijing have been surprised by two of its aspects.

One: famous singers and actors have been arrested for using drugs. Two: random urine tests on the general public have led to detentions and to foreigners being thrown out of the country.

Returning from the Ukraine war zone, I met up with friends for a few beers in the Beijing summer night. So there we were outside "Dos Kolegas": a venue popular with both Chinese and foreigners with its cheap and cheerful approach and especially because of its support of the vibrant live music scene here.

When about a dozen police turned up, both uniformed and plain clothed, this was not going to be a noise complaint matter.

I heard an officer order one of his juniors to block all exits and to not let anybody leave. He asked one man if he was running the bar. Sure enough he was. The boss was then told to instruct all present to do the following : "Foreigners show your passports", "Chinese show your ID cards".

"This is a random test by municipal police," the officer said. "Tell them to cooperate with us."

Space to play or pause, M to mute, left and right arrows to seek, up and down arrows for volume. Listen Duration: 5 minutes 32 seconds 5 m Random urine tests now part of Beijing hospitality ( Stephen McDonell ) Download 10.2 MB

They took down everyone's name, phone number, and settled for a passport number or ID number. I was asked who I worked for.

This was a drug raid.

One policeman carried a bag full of small containers. Everybody in the bar was ordered to do an on-the-spot urine test.

With toilet doors open police watched as we gave samples one by one. Women too had to squat with the toilet door open. A police woman would stand in the doorway and partially block the view of those who walked about in front of the stalls.

As soon as a sample was handed over it was held up to the light. In some cases there was a reaction. From where I stood I could not see what this was but those who "failed" the test were taken outside the bar and made to sit on the ground with their hands tied behind their backs - heads down. Some had their mouths taped closed. Policemen stood over them and ordered them not to speak.

About 10 patrons were deemed to have not passed the test. It was hard to count in the dark but some four or five were foreigners.

One man told police he couldn't pee and was given medication to make him urinate.

After about an hour the "guilty" were taken away in police vans.

Beijing police stand guard at Dos Kolegas. There was only one drug test and if you failed it - gone!

People were not found to have sold drugs nor bought drugs. They were not guilty of carrying drugs. They were not caught taking drugs. They were judged to have, at some point in the past, smoked marijuana.

There was only one test and if you failed it - gone!

One of those caught was a tourist who had only been in the country for two days.

After being taken away, the first stop was the Shuangjing Police Station for a 24-hour questioning period. Then, the foreigners at least, were taken to a detention centre for a two-week stint prior to deportation.

No lawyers. No right of appeal. No telephone calls allowed. Though one man was able to text a friend saying he would be detained for more than 10 days.

Foreigners being held have now been permitted a brief visit from a diplomat representing their embassy. The upshot of these visits is that they will definitely be deported.

Friends of those in detention have asked whether a more lenient approach might be considered. But China is in the midst of a crackdown on many fronts. Police responded that they could not appear to be showing favouritism towards these people because it could be misconstrued as corruption in a climate when the Chinese government says it is striking hard on all things corrupt.

Even the famous have not been able to wangle their way out of drug busts lately.

Those running into trouble with the law over drugs are having their names sprayed all over the media: in March it was singer Li Daimo; in June movie directors Zhang Yuan and Ning Caishen; in July actors Zhang Mo and He Shengdong and this month actor Gao Hu.

Chinese media has reported that 42 artist management agencies have signed an agreement with police pledging to crack down on illegal drug use among their clients. Premier Li Keqiang has labelled drugs a "common enemy of humanity".

The strange thing though is why hit this bar at this time?

There are much larger establishments, which - if raided - would no doubt net a bigger haul of drug users among their clientele. The widely held view here is that more prominent bars pay off all the right people to make sure they're not targeted.

Back at Dos Kolegas I noticed one patron who seemed to be the "insider" that night leading police to this place. Perhaps he'd been caught himself in the past and was given a more lenient sentence for reporting others.

Either way this incident has drawn considerable attention here. Following the raid I sent out the tweet:

Loading

According to Twitter 15,500 people have read it.

There is a large disconnect between the attitudes of many people towards the personal use of marijuana and the views of those enforcing the law but, in this country at the moment, especially in the Chinese capital it seems you're taking quite a risk if you decide to take illegal drugs and, with random testing, it's a risk that lingers in your body for quite a long time.

Stephen McDonell is a foreign correspondent for the ABC. View his full profile here.