 Within a few years after he wrote it all throughout the 19th century and into the 20th century became more and more popular. But still, it was only one of many songs that were played, including Yankee Doodle Dandy and others. And it wasn't until 1931 that Congress enacted a resolution that made the Star Spangled Banner the national anthem. It was controversial. There were hearings on Capitol Hill.