"Stop in the name of the law" came into being in England when the first police force was formed by Sir Robert Peel, Home Secretary, in 1829. Initially it consisted of 1000 "Peelers" or "Bobbies" who maintained law and order in London. Their success soon prompted other parts of the UK to set up their own police forces.
When approaching a suspected criminal, the police officers could command them to stop by saying, "Stop in the name of the law." If the person tried to run off he would be chased by the police officer still shouting his "stop" order and blowing a warning whistle. This frequently encouraged members of the public to join in the chase and capture the suspect.
I'm not sure whether or not Britain's police force was a model adopted by other countries.
Edit: I may be completely wrong. Earlier societies must have had guardians of the law who may well have used the same phrase.