In early 20th century Japan, the narrator, a university student, meets an enigmatic and aloof older man whom he calls Sensei. For reasons that he himself is not completely aware of, the narrator is drawn to Sensei and so while staying in Tokyo for his university he often visits Sensei and his wife at their quiet home to talk with Sensei. Although Sensei gives the narrator a great deal of advice on life, he is hesitant to reveal the details of his own dark past from which he has acquired those lessons, which frustrates the student's curiosity and earnestness to learn.
When the narrator receives word that his father's illness has worsened, he leaves Tokyo for his provincial hometown, where he finds that even though his father actually seems rather well; there is a painful distance between him, an educated and urban young man, and his family. Soon afterwards he returns to Tokyo and finishes his university education, all the while talking with Sensei.
However, the next time the narrator is called back home due to his father's illness, it turns out to be much worse, to the point that his father goes through a terrible physical decay and seems moribund. As the family awaits the father's death, the narrator receives a long letter from Sensei at the end of which he states that he is going to die. Immediately, the narrator leaves his father's deathbed and rushes to Tokyo.
In Sensei's testament, the secretive man reveals the past events that made him lose all hope in himself and the rest of humanity. Orphaned at a young age, Sensei allows his beloved uncle to take care of his inheritance while he attends university in Tokyo, but then he discovers that his uncle has cheated him of much of it. This incident makes Sensei very distrustful of other people, but when he moves in to board with a widow, Okusan, and falls in love with her beautiful daughter, Ojosan, he becomes more outgoing and less melancholy.
Hoping that the environment of Okusan's and Ojosan's home would help one his university friends, to whom he refers as ‘K’, Sensei arranges for him to stay with them. K, the son of a priest, is a strict, almost ascetic idealist who wants to achieve some kind of spiritual glory above all worldly things. Because of this, he becomes tormented when he too falls in love with Ojosan. After Sensei sees K and Ojosan getting closer and K confesses his love for Ojosan to Sensei, Sensei becomes desperately jealous; he impulsively gets engaged to Ojosan and then attacks K using the idealistic things he has said before. Not long after, K commits suicide, and, feeling responsible for it, Sensei considers suicide even as he is married to Ojosan.
Instead, he decides to deny himself life by living a completely idle life, but after the death of the Emperor Meiji and the ritual suicide of General Nogi to follow the emperor, his lord, to the grave, Sensei feels that he has found the right time to die. Having finished writing his testament, he kills himself.