Rob Kardashian

Detained by Police

After 'Joke' Goes Wrong

3/26/2012 4:15 AM PDT BY TMZ STAFF

Rob Kardashian tried joking around with a paparazzo in Miami early Sunday morning ... and he ended up handcuffed and nearly arrested as a result ... TMZ has learned.

Sources close to Rob tell TMZ he was out with some friends when he saw a photog taking pictures from across the street. We're told Rob thought it would be funny to start sprinting towards the photog ... but the photog didn't laugh and instead ran away screaming for help.

According to our sources, Rob followed the guy into a smoke shop to try and clear the air (no pun intended) but the police saw the whole thing and decided to get involved (see video below).

We're told cops interviewed both Rob and the photog -- even putting Rob in the back of a police car. But after Rob explained to them it was all a misunderstanding, he was released.

And that's why you never chase after strangers.

According to the Miami Beach PD, it went down pretty much just like that. The report says Rob ran after the photog, but never threatened him. The police determined there was no altercation, so they let them both go.