Answer:
He had boarded the ship to negotiate the release of an American civilian imprisoned by the British, and had been detained aboard as the bombardment began. (via: https://amhistory.si.edu/starspangledbanner/francis-scott-key.aspx )
Explanation: