Image copyright Thinkstock

Canadian police have arrested 104 men in connection with a child prostitution ring in and around the Toronto area.

York Regional Police say the men attempted to purchase sex with an undercover officer, who posed as a girl between the ages of 13 and 16 online.

Police targeted men who searched for prostitutes online, but did not arrest men who were seeking sex with an adult.

In Canada, adults are allowed to sell sexual services, but it is illegal to buy sex.

"We stopped 104 men from purchasing 104 children," Det Sgt Thai Truong said during a press conference on Friday.

The investigation, dubbed Project Raphael, lasted four years.

The goal of the undercover operation was to reduce demand for child prostitution by putting the men who seek it out behind bars, according to police. An undercover officer would engage with men looking to buy sex online, and then tell them that she was underage.

"Once they were told they were speaking with children, for the most part the men would stop," PC Truong said.

During that time, officers were also able to rescue about 85 child victims. However, police say they were only able to arrest about half of the pimps in those cases because the girls were too afraid to participate in the investigation.

Many of the girls showed signs of physical abuse, PC Truong said.

PC Truong says that most victims of sex trafficking began prostitution at about the age of 14.

Of the 104 cases placed before the courts, 40 of the cases have been resolved, with 64 still before the courts. About a quarter of the accused plead guilty. Four went to trial and of those four, three were found guilty and one man was acquitted.

Five cases of the 104 were withdrawn.

In Canada, soliciting the sexual services of someone under 18 is a crime punishable by six months to 10 years in prison for first-time offenders.