It's true.
Francis Scott Key was a prisoner aboard a British warship when he penned the immortal words of The Star-Spangled Banner. He had gone aboard a British ship to obtain the release of another American, but was detained overnight by the British. At the dawning of the day he was so thrilled to see the Stars & Stripes still flying over Fort McHenry that he wote a poem on the back of an envelope to commemorate the memorable occasion. The poem was later set to the music of a tune probably written by a British composer.
For the full story, please go to Our National Anthem.