TL;DR - 29 September, 1829 for Western Europe if you go by the date of the first patrols.
In Europe the first modern police force is regarded as being the Marine Police Force created in 1798; this is the first organization in the West that has the characteristics you mention, like being paid professionals and not being the army. Before that some analogous organizations existed in England, like the Bow Street Runners who could reasonable be called the first modern detective force, but for the most part law enforcement was handled by a hodgepodge of unpaid chumps who came by their authority through various means. In 1805 the Bow Street Runners added the Horse Patrol, but they were unofficial and operated a lot more like bounty hunters than policemen, being paid as they were by interested members of the public.
The real game changer was a man named Robert Peel, who was appointed Home Secretary in 1822. It had become pretty clear that industrialization and the demographic changes that had come with it had rendered the traditional system of English law enforcement ineffective, so the Metropolitan Police Act was passed in response. Your question about police actions before this time being carried out by armies is very apropos, because it was exactly this fear that Robert Peel had to deal with. Because of their history of fighting their own government, the English have kind of a thing about standing armies and the capital, so Robert Peel explicitly organized the Metropolitan Police as a non-military organization that was answerable to the public in a way that the army wouldn't be by issuing them public individual identification (this is where the idea of the badge number comes from). This philosophy even extended to their kit, which included a blue uniform (remember that the British were famous for wearing red in a military context) and no weapons (this later changed after it became apparent that everybody else in early-industrial London had firearms).
That answers your question, so here are some facts that I've always enjoyed about the early days of modern law enforcement that I couldn't find a way to fit into my explanation:
-You know the British expression "Bobbies", often used to refer to the police? Yeah, that's a reference to Robert Peel.
-Their history of fighting the King wasn't the only reason the English were skeptical of a standing police force. Evidently before the advent of the Metropolitan Police, the city of Paris had maintained the largest paid law enforcement apparatus in Europe. At this point the English had just gotten done fighting the French for nearly 25 years straight, so the Frenchness of the idea was actually a major hurdle to public acceptance.
-The famous police whistle had to be invented; a competition was held in the 1880s to design a replacement because the original solution used by officers to raise the alarm, a hand rattle, was widely regarded as sucking.
-The detective force I mentioned, the Bow Street Runners? Introduced by the novelist and playwright Henry Fielding, known for his satire and moderately dirty humor.
Sources:
-Ramsay, Anna - Sir Robert Peel. Books for Libraries Press, 1928.
-Mason, Gary - The Official History of the Metropolitan Police. Carlton Books, 2004
-Adelman, Paul Peel and the Conservative Party. Longman, 1989.
^ This last one isn't exactly about the Met, but it provides a lot of valuable context regarding the political situation in England at the time.
Edit: TL;DR said 1929, which is wrong.
I can't comment on Western police, but in Japan, after the establishment of the Tokugawa Shogunate in the 1600s, there wasn't much need for an army anymore. To keep the samurai employed, Tokugawa reorganized them into a police force. These police were typically armed with swords and would serve not only as police but as judges and detectives as well. One could argue that they operated like the "Judges" in the Judge Dredd series.
They later played a role during the Meiji restoration as some of them fought on behalf of the Shogunate against pro-Imperial forces. There was also the establishment of the Shinsengumi, which one could describe as a secret police force that continued to fight for the Shogunate even after it was over. The remnants were incorporated into the local Metropolitan Police of Japan-the most notable one being the Tokyo Metropolitan Police.
City Watchmen have existed for a long time, and acted as policemen, maintaining public order and brought criminals to justice.
Sweden got its first chief of police 1776, but he controlled not police officers but the city watchmen, who were both fire brigade and keepers of public order.
The first Swedish police organisation strictly focused on maintaining order was formed 1850 in Stockholm as a response to the 1848 demonstrations, when the military had to be called in and several demionstrators ended up shot dead.