NIAGARA COUNTY, N.Y. — With a history that spans more than 300 years, Fort Niagara is the oldest continuously occupied military sites in America. 

Built by the French, captured by the British and then ceded to the United States, three different flags have flown there. One flag in particular indirectly inspired a nation and stands higher than the rest says Curator Jerome Brukaber. 

"It predates the star spangled banner, and is actually sort of the model for the star spangled banner," says Brukaber.

The Fort Niagara flag is considered one of the most historic artifacts in Western New York.

"It was captured by the British when they took the fort in 1813," Brukaber said. "Then it went back to England and eventually Scotland where it stayed until 1993 when we found it." 

It was even caught in a fire in a castle in Scotland before Fort Niagara officials discovered and brought it back. Now, visitors can get an up-close look at the massive proportions of the flag. 

It was originally 22 feet tall and 36 feet wide, and the brain child of a young officer at the fort named Major George Armistead. The officer distinguished himself by leading the assault that captured Fort George across the river in Newark, now known as Niagara-on-the-Lake.

"Because he is a young, up-and-coming officer, they commission him to take the captured flag from Fort George to Washington," says Niagara County Historian Catherine Emerson.

Being a Virginia native, Armistead may have relished his time at Niagara, but hated the winters, so he jumped when they offered him a new position. He took command of Fort McHenry in Maryland.

Among Armistead's first tasks was to commission a flag. So he remembered the flag he commissioned at Fort Niagara and decided to replicate it, right down to the 15 stars and 15 stripes. Armistead said he wanted a flag so big that the British would have no difficulty seeing it from a distance. 

But the flag became part of Americana when it was seen, not only by the British, but by a 35-year-old lawyer and amateur poet named Francis Scott Key. He put his inspiration to paper upon seeing the American flag flying triumphantly above the fort after the British assault. While the Fort McHenry flag is in the Smithsonian today, its inspiration still lives at Fort Niagara. 

RELATED: Old Fort Niagara hosts last re-enactment of the season

RELATED: American Revolution re-enactments held at Old Fort Niagara