FILE - In this June 1, 2020 file photo, President Donald Trump departs the White House to visit outside St. John's Church, in Washington. Part of the church was set on fire during protests on Sunday night. Walking behind Trump from left are, Attorney General William Barr, Secretary of Defense Mark Esper and Gen. Mark Milley, chairman of the Joint Chiefs of Staff.  Milley says his presence “created a perception of the military involved in domestic politics.” He called it “a mistake” that he has learned from.  (AP Photo/Patrick Semansky)
FILE - In this June 1, 2020 file photo, President Donald Trump departs the White House to visit outside St. John's Church, in Washington. Part of the church was set on fire during protests on Sunday night. Walking behind Trump from left are, Attorney General William Barr, Secretary of Defense Mark Esper and Gen. Mark Milley, chairman of the Joint Chiefs of Staff. Milley says his presence “created a perception of the military involved in domestic politics.” He called it “a mistake” that he has learned from. (AP Photo/Patrick Semansky)

Army Gen. Mark Milley said he was wrong to have accompanied the president on his June 1 walk through Lafayette Square to St. John’s Church, where Trump held a bible aloft in an awkward publicity stunt. 

America’s top military officer apologized Thursday for participating in President Donald Trump’s photo op outside a church in Washington, D.C., which saw law enforcement use tear gas, flash-bangs, and rubber bullets to clear the area of nonviolent protesters.

Army Gen. Mark Milley said he was wrong to have accompanied the president on his June 1 walk through Lafayette Square to St. John’s Church, where Trump held a bible aloft in an awkward publicity stunt. 

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

Milley said his appearance in the photographs compromised his commitment to a military that is supposed to remain apolitical. “As a commissioned uniformed officer, it was a mistake that I have learned from, and I sincerely hope we all can learn from it,” he said.

Milley’s comments mark his first public statements since Trump’s photo op. In issuing an apology, Milley becomes just the latest military official to either explicitly or implicitly denounce Trump’s stunt.

RELATED: All of the War Heroes and Decorated Military Leaders Speaking Out Against Trump

Mike Mullen, a retired Navy admiral and the former chairman of the Joint Chiefs of Staff denounced Trump last week. 

“It sickened me yesterday to see security personnel—including members of the National Guard—forcibly and violently clear a path through Lafayette Square to accommodate the president’s visit outside St. John’s Church,” Mullen wrote in The Atlantic. “Whatever Trump’s goal in conducting his visit, he laid bare his disdain for the rights of peaceful protest in this country.”

Trump’s former defense secretary James Mattis also broke his long-held silence to criticize the president’s politicization of the military in the pages of The Atlantic.

“When I joined the military, some 50 years ago, I swore an oath to support and defend the Constitution,” Mattis wrote. Never did I dream that troops taking that same oath would be ordered under any circumstance to violate the Constitutional rights of their fellow citizens—much less to provide a bizarre photo op for the elected commander-in-chief, with military leadership standing alongside.”

This torrent of criticism reflects a growing divide between Trump and military personnel. Trump has criticized protesters and threatened to use the military on them, but military leaders have taken a different approach, acknowledging the issue of systemic racism and making clear they do not want to see troops deployed against American civilians.

Defense Secretary Mark Esper said last week that he opposed deploying active-duty troops on the streets of Washington D.C. to confront protesters, earning him a verbal lashing from Trump. Milley is now likely to earn a similar rebuke, given Trump’s known disdain for those who publicly criticize or disagree with him. 

In his speech, Milley said that all senior military leaders must be aware that their words and actions will be closely watched.

“And I am not immune,” he said, noting the photograph of him at Lafayette Square. “That sparked a national debate about the role of the military in civil society.” He expressed regret at having been there and said that it was a reminder that those in uniform are not just soldiers, but also citizens.

“We must hold dear the principle of an apolitical military that is so deeply rooted in the very essence of our republic,” he said. “It takes time and work and effort, but it may be the most important thing each and every of us does every single day.”

RELATED: This Week’s Protests Are About More Than George Floyd’s Death. The Data Shows It.

Milley also expressed his outrage at the police killing of George Floyd and urged military officers to recognize it as a reflection of centuries of injustice toward Black Americans, beginning in 1619, when the first enslaved Africans arrived on the shores of colonial Virginia. 

“What we are seeing is the long shadow of our original sin in Jamestown 401 years ago.” 

The Associated Press contributed to this report.