US President Barack Obama said Monday that NFL quarterback Colin Kaepernick was exercising his constitutional right by refusing to stand for the national anthem, although he added that the nature of the protest could make it hard for some to hear his message. Kaepernick sparked controversy last month when he remained seated before a preseason game during the traditional rendition of "The Star-Spangled Banner," saying it was a protest against racial injustice and police brutality. During a second game last week, the San Francisco 49er took one knee instead of standing. Many Americans have denounced the gesture as a sign of disrespect to the flag, though he has drawn support from some people, including some fellow players and Megan Rapinoe, a star of US women's national soccer team. Speaking in China after a gathering of leaders of 20 leading economies, Obama said he had no doubt about Kaepernick's sincerity but acknowledged that the protest was difficult for some members of the military and law enforcement to swallow. "I think there are a lot of ways you can do it as a general matter when it comes to the flag and the national anthem and the meaning that that holds for our men and women in uniform and those who've fought for us. That is a tough thing for them to get past to then hear what his deeper concerns are," Obama said. Kaepernick, who led San Francisco to the 2013 Super Bowl but has since been demoted to backup, is the latest professional athlete to use his celebrity to call attention to the issue of the mistreatment of minority groups by law enforcement. Over the past two years, a series of police killings of African-Americans in cities across the country have triggered protests and given rise to the Black Lives Matter movement. Despite the controversy, Obama said he would rather have engaged young people "trying to think through how they can be part of our democratic process than people who are just sitting on the sidelines and not paying attention at all." Obama, speaking at a news conference, said he had not been following the controversy closely, but added, "If nothing else what he's done is he's generated more conversation around some topics that need to be talked about. "Sometimes it's messy, but it's the way democracy works." In a gesture of solidarity with Kaepernick, Rapinoe knelt during the national anthem at a match Sunday played by her professional team, the Seattle Reign, telling American Soccer Now that she was disgusted by the way Kaepernick has been treated in the media. Although some American football fans have demanded that the National Football League punish Kaepernick, the NFL has issued a statement saying it encourages players to stand during the anthem but does not require them to do so. The 49ers have framed the issue in terms of all Americans' right of free expression.