The short story "The Last Leaf" by O. Henry tells of a trio of struggling painters in Greenwich Village. Two women, Sue and Johnsy, share an apartment, and their neighbor Mr. Behrman lives downstairs.
An outbreak of pneumonia hits Greenwich Village, and Johnsy becomes ill. The doctor says that it is important for her survival that she has the will to live. However, she has resigned herself to death and decides that when the last leaf falls from a tree outside the window of her apartment, she will die.
Behrman is presented as a failed painter who drinks too much and makes a scant livelihood posing for other painters. He speaks of painting a great masterpiece but has never followed through with his boasting.
In despair, Sue goes to Behrman and tells him of Johnsy's resignation to death. Behrman becomes upset but, at the time, offers no solution.
This is where O. Henry's genius for surprise endings comes in. Johnsy continues to watch the last leaf on the tree, but despite rain and wind, it does not fall—it continues to hang on the branch. Johnsy regains her will to live and gets better. Only then does Sue tell Johnsy that Behrman has died of pneumonia. He went outside in the freezing night and painted the leaf so that Johnsy would see it and not give up. He gave up his life to save Johnsy. That's why the single leaf that he painted is his masterpiece. The painting of it saved a precious human life.