The Sept. 27 ceremony, held on Gold Star Mother’s and Family’s Day with dozens of people in attendance, recognized the families of 20 deceased service members, according to a copy of the event program obtained by The Washington Post.

President Trump, Vice President Pence, Defense Secretary Mark T. Esper and some of the military’s top generals and admirals were also at the event, which was held in the East Room. Most attendees did not wear masks or maintain social distancing, White House photographs of the event show.

Adm. Charles W. Ray, the vice commandant of the Coast Guard, tested positive for the coronavirus on Monday, the service said in a statement on Tuesday. He had begun experiencing mild symptoms over the weekend, a week after attending the Gold Star event, but “is in good spirits,” Rear Adm. Jon Hickey, a senior Coast Guard spokesman, said in the statement.

“In accordance with established Coast Guard COVID policies, he will be quarantining from home for the required 14-day timeframe, where he will continue to perform his duties as Vice Commandant,” Hickey said.

Other senior defense officials who attended the White House event include Army Gen. Mark A. Milley, the chairman of the Joint Chiefs of Staff; Gen. Charles Q. Brown Jr., the chief of staff of the Air Force; Gen. David H. Berger, the commandant of the Marine Corps; Gen. James McConville, chief of staff of the Army; and Army Secretary Ryan McCarthy.

Ray’s positive test forced several members of the Joint Chiefs of Staff into quarantine, including Milley. But in a statement, the Pentagon attributed the move to Ray’s participation Friday in a meeting at the Pentagon with Milley and several service chiefs. No other senior military official had tested positive as of Tuesday, said Jonathan Rath Hoffman, the chief Pentagon spokesman.

Brian Morgenstern, a White House spokesman, cited the testing of attendees before the gathering as evidence that precautions were taken.

“It’s critically important that we reopen the country, and it’s critically important that we honor these families,” Morgenstern said. “Had anyone tested positive, they would not have been continuing to attend.”

Attendees received a coronavirus test the same afternoon of the 5 p.m. event, said Ann Lewis Hampton, whose daughter, Army Capt. Kimberly Hampton, was killed in a helicopter crash in Iraq in 2004 and was among those recognized at the White House. Family members wearing masks waited in an auditorium for results, toured the White House, met with the president and took pictures with him before they were seated in the East Room, Hampton said.

“It was a wonderful, once-in-a-lifetime event,” she said. “I feel like our heroes, our fallen, were honored very respectfully, and it was just a beautiful event.”

The ceremony was held one day after the president welcomed Judge Amy Coney Barrett to the White House as his next Supreme Court nominee. Numerous senior administration officials who attended that event, including Trump, have since tested positive for the virus.

Trump’s positive test was announced early Friday. Hampton said White House officials did not inform her of the outbreak. Two other people familiar with planning for the event, who like several others spoke on the condition of anonymity because of the sensitivity of the issue, said the White House did not contact most of the families, if any.

Hampton, who lives in a South Carolina retirement community, said she has voluntarily quarantined herself since returning home.

Another Gold Star mother who attended the event with Hampton reached out to the White House afterward and received an email that confirmed that everyone at the military event had tested negative for the coronavirus on Sept. 27. The email also stated that Trump had “several negative tests” between that Sunday evening and his positive test on Thursday, Hampton said.

“We’re talking from Sunday to Thursday, and we were told that he had negative tests in between Sunday and Thursday,” she said. “I have not been concerned at all because I felt very comfortable at the event. I’ll be honest with you: I was a lot more uncomfortable with the plane, the hotel and the restaurant than going to the White House.”

Morgenstern said the White House did not contact the families because all attendees tested negative Sept. 27 and no positive tests were recorded in the first 48 hours afterward.

The White House event included the lighting of a candle to recognize the deceased service member from each family attending, performances by military musicians and a 10-minute speech by Steven Xiarhos, a retired deputy police chief from Barnstable, Mass., who is running for state representative as a Republican.

Xiarhos, whose son Nicholas was killed in Afghanistan in 2009, said in a Facebook post on Friday afternoon, after the disclosure of Trump’s diagnosis, that he had tested negative and told his daughters, who accompanied him, to also get tested.

“I will be following all the remaining recommendations regarding COVID and quarantine guidelines,” wrote Xiarhos, who did not respond to interview requests. “My thoughts and prayers are with the President, First Lady, the White House staff, and all the Gold Star Families. It’s all surreal.”

The possibility that the coronavirus could have been in the room with senior defense officials drew attention to some of their recent travel. Esper was tested the following day ahead of a trip last week to Northern Africa and the Middle East, and again last Wednesday and Friday, a senior defense official said.

Rep. Adam Smith (D-Wash.), the chairman of the House Armed Services Committee, said the quarantine of service chiefs and Ray’s diagnosis on Tuesday was proof that Trump has mishandled the coronavirus crisis.

“While our military can still operate while leadership is quarantined, the national security implications of the President’s recklessness cannot be overstated,” Smith said. “Our adversaries are always looking for any weakness to exploit. President Trump’s pathetic attempts to exude strength aren’t fooling anyone — Americans know he is weak and so do those who wish us harm.”

Those quarantined after the Pentagon meeting include Milley; Brown; McConville; Gen. John Hyten, the vice chairman of the Joint Chiefs; Adm. Michael Gilday, the chief of naval operations; Gen. John Raymond, the Space Force chief of staff; Gen. Daniel Hokanson, the chief of the National Guard Bureau; and Gen. Paul Nakasone, the head of U.S. Cyber Command, a defense official said.

Paul Sonne contributed to this report.