According to wiki...
// The Anacreontic Song", also known by its incipit "To Anacreon in Heaven", was the official song of the Anacreontic Society, an 18th-century gentlemen's club of amateur musicians in London. Composed by John Stafford Smith, the tune was later used by several writers as a setting for their patriotic lyrics. These included two songs by Francis Scott Key, most famously his poem "Defence of Fort McHenry". The combination of Key's poem and Smith's composition became known as "The Star-Spangled Banner", which was adopted as the national anthem of the United States of America in 1931.
"The Anacreontic Song"
First page of the A. Blands edition (c. 1784–1790)
Song by The Anacreontic SocietyPublished1778 (words only)
c. 1780 (music)Composer(s)John Stafford SmithLyricist(s)Ralph Tomlinson //
So it originated in an 18th c British gentlemen's club.