<P> On September 3 , 1814 , following the Burning of Washington and the Raid on Alexandria , Francis Scott Key and John Stuart Skinner set sail from Baltimore aboard the ship HMS Minden , flying a flag of truce on a mission approved by President James Madison . Their objective was to secure an exchange of prisoners , one of whom was Dr. William Beanes , the elderly and popular town physician of Upper Marlboro and a friend of Key 's who had been captured in his home . Beanes was accused of aiding the arrest of British soldiers . Key and Skinner boarded the British flagship HMS Tonnant on September 7 and spoke with Major General Robert Ross and Vice Admiral Alexander Cochrane over dinner while the two officers discussed war plans . At first , Ross and Cochrane refused to release Beanes but relented after Key and Skinner showed them letters written by wounded British prisoners praising Beanes and other Americans for their kind treatment . </P>
<P> On September 3 , 1814 , following the Burning of Washington and the Raid on Alexandria , Francis Scott Key and John Stuart Skinner set sail from Baltimore aboard the ship HMS Minden , flying a flag of truce on a mission approved by President James Madison . Their objective was to secure an exchange of prisoners , one of whom was Dr. William Beanes , the elderly and popular town physician of Upper Marlboro and a friend of Key 's who had been captured in his home . Beanes was accused of aiding the arrest of British soldiers . Key and Skinner boarded the British flagship HMS Tonnant on September 7 and spoke with Major General Robert Ross and Vice Admiral Alexander Cochrane over dinner while the two officers discussed war plans . At first , Ross and Cochrane refused to release Beanes but relented after Key and Skinner showed them letters written by wounded British prisoners praising Beanes and other Americans for their kind treatment . </P>
who was the president when the national anthem was written
who was the president when the national anthem was written
President James Madison
President James Madison