The swan song is a metaphorical phrase for a final gesture, effort, or performance given just before death or retirement. The phrase refers to an ancient belief or animal folklore that swans sing a beautiful song in the moment just before death, having been silent (or alternatively, not so musical) during most of their lifetime. This belief, whose basis in actuality is long-debated, had become proverbial in ancient Greece by the 3rd century BC, and was reiterated many times in later Western poetry and art.

In Greek mythology, the swan was a bird consecrated to Apollo, and it was therefore considered a symbol of harmony and beauty and its limited capabilities as a singer were sublimated to those of songbirds.

More Info: en.wikipedia.org