The nation’s top military official has apologized for taking part in President Donald Trump’s walk from the White House to St. John’s Church for a controversial photo op after authorities used pepper balls and smoke cannisters to disperse largely peaceful protesters.

“I should not have been there,” said Gen. Mark Milley, the chairman of the Joint Chiefs of Staff, in a prerecorded video commencement address to National Defense University. “My presence in that moment and in that environment created a perception of the military involved in domestic politics.”

Milley, who was wearing combat fatigues, and Defense Secretary Mark Esper were the target of widespread criticism from current and former leaders for their participation last Monday.

Both said they believed they were accompanying the group to thank National Guard troops and other law enforcement officers outside Lafayette Square, Esper said last week.

“As a commissioned uniformed officer, it was a mistake that I have learned from,” Milley said in the video address.

Milley also said he, like many Americans, is “outraged” in the wake of George Floyd’s death.

“I am outraged by the senseless and brutal killing of George Floyd. His death amplified the pain, the frustration, and the fear that so many of our fellow Americans live with day in, day out,” Milley continued. The protests that have ensued not only speak to his killing, but also to the centuries of injustice toward African Americans,” he added, saying, “We should all be proud that the vast majority of protests have been peaceful.”

“As senior leaders, everything you do will be closely watched. And I am not immune. As many of you saw, the result of the photograph of me at Lafayette Square last week. That sparked a national debate about the role of the military in civil society,” he said.

This is a developing story. Please check back for updates.