A man suspected of attacking a child who was wearing a hat during the US National Anthem believed he was encouraged by Donald Trump to carry out the assault, according to his lawyer.

Curt Brockway, a 39-year-old US Army veteran who was charged on Monday in the assault, suffered a traumatic brain injury in a vehicle crash in 2000 that has affected his decision making, attorney Lance Jasper told the Missoulian.

The lawyer said he will seek a mental health evaluation for Mr Brockway, who seemingly became caught up in the heightened animosity and rhetoric gripping the nation, and convinced himself that he was following the president’s orders.

“His commander in chief is telling people that if they kneel, they should be fired, or if they burn a flag, they should be punished,” Mr Jasper said.

He added that Mr Brockway “certainly didn’t understand it was a crime.”

Mr Brockway told a sheriff’s deputy that he asked the boy to remove his hat out of respect for the national anthem before the start of the county rodeo, Mineral County Attorney Ellen Donohue wrote in the document describing the attack.

The boy reportedly cursed at Mr Brockway in response, and the man grabbed him by the throat, “lifted him into the air and slammed the boy into the ground,” Ms Donohue wrote.

Mr Jasper’s comments arrived as prosecutors formally charged Mr Brockway with assault on a minor, a felony that carries a maximum five-year prison sentence and a $50,000 (£41,183) fine upon conviction.

Prosecutors said the boy was airlifted to a hospital for a possible concussion and skull fracture. His condition was not immediately known.

Conduct during the playing of the national anthem has been an issue in recent years, with some NFL players kneeling to protest police brutality.

Mr Trump once called for NFL owners to fire players who kneel or engage in other acts of protest during the anthem.

“Trump never necessarily says go hurt somebody, but the message is absolutely clear,” Mr Jasper said. “I am certain of the fact that (Brockway) was doing what he believed he was told to do, essentially, by the president. ... Everyone should learn to dial it down a little bit, from the president to Mineral County.”

The Associated Press contributed to this report