The swallow is a bird who needs to migrate to a warm climate in the winter months. The swallow in this story instead chooses to stay with the Happy Prince in order to fulfill the prince's request for the swallow to peel all the gold leaf off the statue and distribute it to the poor, so that their lives can be made better. The swallow does this until there is no gold left on the statue, but when the Prince asks if now is the time for him to go to Egypt, the bird says he will not leave the Prince. But it is too cold in the kingdom now for the swallow, and soon he recognizes that he will shortly be going to "the House of Death." For a while, he struggles against this, flapping his wings to keep warm, but in his heart he knows it is no use.
The swallow kisses the Prince on the lips and then dies in that moment, having fulfilled his purpose, which causes the lead heart of the Prince to crack in two.