India's patent office has rejected a plea by a Canadian company to patent a vibrator because sex toys violate "public order and morality".

Invoking India's obscenity law, the patent office said the law "has never engaged positively with the notion of sexual pleasure".

The patent office said sex toys are considered to be obscene objects and are illegal in India.

But a 2011 court ruling had said sex toys could not be considered obscene.

An Ontario-based company called Standard Innovation Corporation had applied for a patent in India for a new vibrator, to prevent generic local copycats being sold in the market, according to Shamnad Basheer, a visiting professor of law at India's National Law School who is working on a book about public health law.

In April, the patents office rejected the plea, saying that sex toys lead "to obscenity and moral deprivation of individuals".

"These are toys that are not considered useful or productive. Mostly these are considered to be morally degrading by the law," the office said.

"The law views sex toys negatively and has never engaged positively with the notion of sexual pleasure".

The office also invoked the Section 377 of the Indian Penal Code (IPC), a 155-year-old colonial-era law, which criminalises gay sex and unnatural intercourse, in refusing the patent.

An appeal to strike down provisions of the law is currently pending before the Supreme Court.

"Why should the patents office handle moral decisions? Officials trained in technical science are not supposed to decide whether an invention is moral or immoral," Prof Basheer told the BBC.

Sex toys are openly sold online, and in a thriving black market in India.

A survey by an online store selling sex toys in India last year found that 62% of the buyers of sex toys in India were men, while the remaining 38% were women.