Sex robots are not a bonkers invention of the modern age after all — they were actually conceived by the ancient Greeks.

New research has found that randy members of the Mediterranean classical-era civilization were bent on building sex bots some 2,500 years ago.

In her book, “Gods and Robots,” Adrienne Mayor delves into the weird world of the ancient Greeks and finds numerous accounts of romping with statues that come alive.

Some ancient Greek men developed “statue lust” whereby they fell in love with effigies and even had sex with them.

Mayor said this particular sexual kink arose at a time when Greek and Roman sculptural artistry was achieving a high degree of realism and idealized beauty and some people developed feelings for them.

She said: “Nude cult statues were often treated as though they were alive, given baths, clothing, gifts and jewelry.”

While they did not have the tech know-how, they were able to foresee the possibility of a mechanical maiden.

Mayor says: “In the Pygmalion myth, the sculptor’s ivory statue is clearly…being created for sex.”

After praying to the goddess of love, Aphrodite, she makes Pygmalion’s beloved doll turn into a real woman.

Mayor said: “Its realism became reality supernaturally, thanks to the goddess of love.

“This oft-told ancient ‘romance’ of artificial life takes on new relevance today because it presages ethical questions posed by modern critics of lifelike robotic dolls and AI entities specifically designed for physical sex with humans.

“Although the Pygmalion myth is often presented in modern times as a romantic love story, the tale is an unsettling description of one of the first female android sex partners in Western history.”