President Obama has weighed in on the debate over NFL quarterback Colin Kaepernick’s boycott of the national anthem. Noting the difficulties with the stand, he ultimately backed Kaepernick’s constitutional right to protest.

Obama made the comments at a press conference following a meeting of world leaders at the G20 Summit in China.

Obama on @Kaepernick7: "I think he cares about some real, legitimate issues that have to be talked about." pic.twitter.com/htPDCsqg6c — Michael Skolnik (@MichaelSkolnik) September 5, 2016

The outgoing president recognized Kaepernick’s sincerity and said he would rather have young people engaged in the democratic process than not paying attention at all.

"If nothing else, what he's done is he's generated more conversation around some topics that need to be talked about,” the president said.

"Sometimes it's messy, but it's the way democracy works."

Kaepernick sparked major controversy last month when he stayed sitting during the national anthem at a game between his team San Francisco 49ers and the Green Bay Packers.

The football star later issued a statement saying the act was a protest over racial injustices and police brutality in the US.

During another game last week, Kaepernick knelt instead of standing. His actions have divided opinions, with many political figures expressing their views on the 28-year-old football player’s actions.

Republican presidential candidate Donald Trump said the sports star should “find a country that works better for him.”

While Democratic vice presidential candidate Tim Kaine said although he would have gone about it differently, he respected people’s “ability to act according to their conscience.”

President Obama admitted the type of protest is difficult for some 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."

Army veterans, however, were among those to voice support for Kaepernick last week using the hashtag #VeteransforKaepernick





Don't use my service--or that of any veteran--to justify the silencing of black Americans. Not on my watch. #VeteransForKaepernick — Charles Clymer (@cmclymer) August 31, 2016

You don't fight for freedom of speech then criticize someone for actually using it. #VeteransForKaepernickpic.twitter.com/QmhJl9SSXn — Josh Belcher (@_blr_d) August 31, 2016

Megan Rapinoe, a star of the US women's national soccer team, also joined Kaepernick in solidarity by choosing to kneel during a game Sunday.

READ MORE: US women's soccer star Rapinoe joins Kaepernick anthem protest

The NFL issued a statement in reaction to criticism from some football fans saying it encourages players to stand during the anthem but does not require them to do so.