U.S. Vice President Mike Pence walked out of a National Football League game on Sunday after some players knelt during the national anthem, a form of demonstration that began last year in silent protest against police violence toward racial minorities.

Pence was attending a game in his home state of Indiana between the Indianapolis Colts and the San Francisco 49ers.

When the national anthem was played before the start of the game, some 49ers knelt while some Colts, their arms locked, wore black T-shirts with the words "We Will" on the front and "Stand for equality, justice, unity, respect, dialogue, opportunity" on the back.

"I left today's Colts game because President Trump and I will not dignify any event that disrespects our soldiers, our Flag, or our National Anthem," Pence said in a statement issued by the White House.

Critics began to question whether Pence had only attended the game in order to make a production of leaving, pointing out he flew from Las Vegas on Saturday and was then going to fly to California on Sunday evening.

Pence had planned for "several weeks" to attend Sunday's Colts game, where former quarterback Peyton Manning was being honored, an official in his office said, asking not to be named. Additionally, he made a last-minute decision to travel to Las Vegas for a prayer service on Saturday, the official said.

"As he had discussed with the president, when several 49ers players disrespected the flag and the Nation Anthem, the vice president decided to leave the game," the official said.

President Donald Trump said in a tweet on Sunday that he had asked Pence to leave the stadium "if any player kneeled, disrespecting our country."

NFL spokesman Brian McCarthy declined to comment.

The First Amendment of the U.S. Constitution bars the government from limiting free speech, including prohibiting protests of the national anthem or punishing people who choose not to stand. The National Anthem is played before every NFL football game and many other sporting events.

Less than an hour after issuing Pence's statement, the White House released a picture of him and his wife at the stadium where the game took place, standing with hands over their hearts during the performance of the national anthem.

Trump’s criticism of the NFL players has played well with his conservative base while he grapples with controversies over Iran and North Korea, an investigation of Russian meddling in the 2016 election and policy struggles in Congress.

Pence's team Indianapolis defeated San Francisco, 26-23, in overtime.