A photo of the book - I Learn to Control Myself, written by Fita Chakra - has spread across social media since Monday, sparking a discussion online about sexual education and igniting parents' anger.
"Moms, please be careful when you buy a book for your kids. Check and re-check its content," wrote one user on Facebook.
Another said: "If this book is about sex education, why is the description about it so detailed?"
'Targeted at parents'
One page of the book, which has been widely shared online, depicts a cartoon boy lying on a bed. He is saying: "I cross my legs around a bolster tightly. For fun, I move my body up and down. Oh... it feels good. My heart is pounding, but I am happy."
In another screenshot the child says: "I found a new play for fun. Sometimes, I put my hand inside my pants. I repeat, again and again."
In a Muslim majority nation like Indonesia, casual conversations about sex among adults are considered taboo, let alone discussions between parents and children.
But there is a growing awareness about the importance of sex education for children, in part to prevent them from being sexually abused.
Despite this, the Indonesian Child Protection Commission (KPAI) has said I Learn to Control Myself is harmful for children and could lead to "sexual deviance".
The publishers, Tiga Serangkai, said the book was meant to educate children about why they feel how they do, but that "this behaviour is inappropriate and has potential health risks".
"The target of this book is parents who feel their children might have this behaviour. But it also good for all parents and kids as a precaution."
But in their statement, they said they withdrew the book from circulation last December, because some communities were "not ready to teach kids sex education from an early age". Some online bookstores are, however, still selling it.
Author Fita Chakra has written several educational books for children on issues about emotions and bodily development.
She said on Instagram that she felt sad people were just posting one or two pages of the book in question out of context.
"I intensely discussed with the editor about this book long before it was published," she said. "The writing process took a long time," she said.
"Our true intention is to educate children how to protect themselves from sexual abuse. If you read it through, there is a page about tips to parents, because this book is meant to be read with parents' guidance."
Child and family psychologist Vera Itabiliana told the BBC that while it is important to teach children about sexuality in an early age, the book was targeting the wrong audience.
For this particular issue, she said, it would be best if the book was made for parents only, so they can educate their children.
"You should not read this book together with your kids," she said. "Because even though the behaviour is quite common among children between five and six years old, you cannot generalise the trend. Some other children didn't do it."
"So when you put it into a book, and every children can read it, one who didn't even know will feel curious and try."
This is not the first time a book created controversy in Indonesia. On February 2015, a book titled It is Time for Me to Learn Dating, by Toge Aprilianto, was accused of promoting sexual activity to teenagers.