President Barack Obama at a town hall on Wednesday addressed controversy surrounding Colin Kaepernick and other athletes who have chosen to take a knee during the national anthem at games as a form of protest against perceived racial injustice in the US.

A military service member, 1st Lt. James Sutter, said he believes the national anthem is "a time which ... should be reserved to respect our service members" and asked Obama what his position is on athletes sitting it out.

Obama had addressed the controversy before, at a G-20 press conference in China earlier this month, but he went a step further on Wednesday.

"I think that it's ... important for us to recognize that sometimes out of these controversies, we start getting into a conversation, and I want everybody to listen to each other," Obama said.

"So I want Mr. Kaepernick and others who are on a knee, I want them to listen to the pain that that may cause somebody who, for example, had a spouse or a child who was killed in combat, and why it hurts them to see somebody not standing. But I also want people to think about the pain that he may be expressing about somebody who's lost a loved one that they think was unfairly shot."

Obama also defended Kaepernick's right to free speech.

"Part of what makes this country special is that we respect people's rights to have a different opinion and to make different decisions about how they want to express their concerns," Obama said. "And the test of our fidelity to our Constitution, the freedom of speech, to our Bill of Rights, is not when it's easy, but when it's hard."

The controversy started in August when Kaepernick was seen on the sideline sitting in silence during the national anthem before the San Francisco 49ers' preseason game against the Green Bay Packers. The 49ers quarterback later said he was "not going to stand up to show pride in a flag for a country that oppresses black people and people of color."

Paul Szoldra contributed to this report.