Mr. Barr played a far more critical role in the law enforcement response than was initially understood, essentially assuming battlefield control over a hodgepodge of security forces in Washington for days from a command center he set up, according to people who received briefings inside the center. He was effectively the general overseeing the operation that allowed the president his photo op.

As criticism deepened over the havoc surrounding the photo op, Mr. Barr insisted that he took charge because the protest was turning violent and had to be brought under control — not to set up a publicity stunt. But his presence at Mr. Trump’s side that day made him look less like a commander of officers and more like a presidential prop, a situation he privately said made him uncomfortable, according to two people told of those conversations.

In a June 5 interview with The Associated Press, the attorney general gave a hairsplitting description of his role in directing the law enforcement actions. He never issued a “tactical command” to clear the protesters from Lafayette Square, he said, but his attitude was that officers needed to “get it done.”