One of the jokes reads: “Do you know why the German Wehrmacht girls are in the Netherlands? As mattresses for the soldiers.”

The Anne Frank Museum said this was not the only time the teenage girl wrote about sex – mentioning other jokes she had heard the people in her hidden home tell, or the passages about her periods and sexuality.

Writing about the decision to publish pages that Anne clearly wanted to keep hidden, the museum said that her diary – a Unesco-registered world heritage document – held significant academic interest.

But it also said that the pages “do not alter our image of Anne”.

“Over the decades Anne has grown to become the worldwide symbol of the Holocaust, and Anne the girl has increasingly faded into the background,” it said in a statement.

“These – literally – uncovered texts bring the inquisitive and in many respects precocious teenager back into the foreground.”

Anne Frank went into hiding in a secret annexe of her father’s business on 5 July 1942 – about a month after she received a diary for her 13th birthday.

She lived there with her family and their friends, the Van Pels, until their discovery two years later. How they were found after so long in successful hiding remains a mystery.

Anne Frank died of disease in a Nazi death camp in 1945, the year the war ended. Her father, the only family member to survive, published her diary in 1947.