Judging from an essay written by 13th-century Zen master Eihei Dogen, misogyny in Japan at that time was rampant. Monks did not want to bow to nuns, arguing that they had lower spiritual faculties than men and that their femaleness was an obstacle to attaining awakening. Some were claiming that women’s female bodies were the result of bad karma in former lives, and therefore, they were debased creatures. Others were averse to women because, they said, women incited impure desires in men. Some monks went so far as to create practice spaces where women were completely forbidden.

We can guess that these views were gaining serious currency, because it is these views that Dogen shreds in his blistering defense of women and female practitioners of the dharma in “Raihai Tokuzui” (“Paying Homage and Acquiring the Essence”), an essay from his Shobogenzo that Zen teacher Brad Warner has justifiably called a “rant.” Reading this essay in the era of #MeToo provides a joyful experience of seeing the master’s shatteringly ahead-of-his-time thinking, and more importantly, essential guidance for male practitioners of the dharma today.

Related: The Liberation of Uncertainty

Dogen begins his argument by talking about the importance of finding a teacher and quickly affirms that the gender of the teacher is irrelevant. Your practice depends on your own attitude to the dharma, not the form the teacher appears in. In fact, Dogen says, you should endeavor that everything be your teacher, writing, “You should entreat trees and rocks to preach the dharma, and you should ask rice fields and gardens for the truth.”

Dogen then criticizes people who allow social hierarchies to interfere with who they take as a teacher, and begins to zero in on his real topic: what his students’ relationship to women should be. He tells the story of several worthies from China to illustrate the correct relationship to female teachers. In the first, a monk vows to learn dharma even from a 7-year-old girl; in the second, a monk is brought to complete enlightenment by a female teacher who completes what his male teacher left unfinished; and in the third, some monks accept a confrontational rebuke from a female master, which allows them to gain a deeper level of insight.

Dogen has pretty harsh words for those who would not revere women: “There is no doubt that there are many who will not pay homage to women or nuns even if they have acquired the dharma and transmitted it. They do not understand the dharma, and since they do not study it, they are like animals, far removed from the Buddhas and ancestors.”

Dogen holds up the example of China, where he says women who attain awakening are made chief priests of monasteries and preach in the place of honor in the dharma hall. “What is there about the male intrinsically to esteem?” Dogen asks. “The female is no different from the male, so both male and female acquire the dharma without distinction . . . So do not think about such differences as male and female.”

Related: The Man-Made Obstacle

Dogen then comes to a true point for the ages. “Also, nowadays,” he says, “there are some extremely stupid men who think, ‘Women are nothing but sexual objects and providers of food.’ They neglect to consider that this kind of thinking results from wrong views. The Buddha’s children should not be like this.”

Dogen continues to say that there are some monks who “detest women because they are objects of desire.” Dogen has no patience for this either and spends several paragraphs tearing into this view. First off, he says, don’t men also arouse sexual desire? In fact, can’t any object in the world arouse desire? Isn’t one to cultivate dispassion toward all of them? Why are women being singled out for aversion and blame? If one is to hate people who might arouse sexual desire, will this not result in everyone hating each other? How will it be possible to undertake bodhisattva practice?

“There are foolish monks in China who vow,” he writes, “‘I will not look at a woman for countless lives to come.’” This incenses Dogen. “What dharma is this based on?” he asks. “What demerit is there in femaleness? What merit in maleness? There are bad men and good women. If you wish to hear the dharma and put an end to pain and turmoil, forget about such things as male and female.”

Dogen then returns to the subject of female teachers, saying that it is well known in China that female practitioners have at times surpassed many male practitioners in their wisdom. He attacks the “laughable” practice of creating monastic areas that are totally off limits to women, thoroughly shredding every aspect of the idea. In one of his most striking arguments, he points out that the Buddhist religion is incomplete without laywomen and nuns, according to the Buddha himself. Such a restricted territory, therefore, presents by definition a maimed version of Buddhism.

Regardless of the questionability of projecting a modern construct onto Dogen, we have here a remarkably feminist manifesto for medieval Japan. The piece is also noteworthy for offering such a cogent example of a master thinking beyond the norms of his society. It should inspire all of us to examine what injustices we are not seeing because our culture is blind to them.

The #MeToo movement has brought male abuse of power into the spotlight, igniting a social-media fire that will hopefully inspire men to hold ourselves to much higher standards. Some argue that the #MeToo movement is flawed, saying that it erases the distinction between petty and serious sexual misconduct, punishes men before they have been proven guilty, and threatens to incite a new era of Victorianism where sexuality is policed. These critiques may be valid and need to be dealt with. Yet who can deny that it is past time for men in all spheres to put into practice the enlightened view that Dogen advocated for six centuries ago, a perspective the #MeToo movement has shown is still far too lacking even in a supposedly progressive culture?

Dogen does not discuss sexual harassment in this piece, which was written for celibate monks. The central theme, however, is the way chauvinism, misogyny, and the failure of men to take responsibility for our own sexuality shatter the healthy relationship that should take place between men and women, one where we can mutually benefit and learn from each other.

It is on men to end sexual harassment and assault of women, whether overt or subtle, and to teach our sons to do the same. That begins with listening to women’s stories and insights, and it ends in the same place listening to the dharma does: in a life of wise self-discipline. The nature of the discipline Dogen recommends is to take responsibility for our own desires and to free our minds, and our dharma practice, from discriminatory prejudices. As he puts it, in relating to each other as human beings beyond the desires and prejudices of gender and sexuality, we practice “a basic law of the Buddha Way.”