The mayor of Annapolis had made a personal appeal to the White House over the weekend, which was rejected Monday, according to a spokesperson for Mayor Gavin Buckley.
But Trump issued a proclamation Tuesday morning honoring the victims of the Capital Gazette shooting and ordered the flags lowered. The order extended to all flags on public buildings, military posts, naval vessels, embassies abroad and other locations until sunset this evening.
"Our nation shares the sorrow of those affected by the shooting at the Capital Gazette newspaper in Annapolis, Maryland. Americans across the country are united in calling upon God to be with the victims and to bring aid and comfort to their families and friends," the proclamation from Trump stated.
Rob Hiaasen, 59, Wendi Winters, 65, Gerald Fischman, 61, John McNamara, 56, and Rebecca Smith, 34, all were shot to death at the Capital Gazette on June 28, allegedly by 38-year-old Jarrod Ramos, who had a longstanding feud with the newspaper and has since been charged with five counts of first-degree murder.
Susan O'Brien, the mayoral spokeswoman in Annapolis, had confirmed in a statement that the mayor requested the flags be lowered, adding: "The Mayor is extremely disappointed by the denial from the White House of his request to fly the United States flag at half staff in honor of the slain journalists from The Capital Gazette. He sees these murders as an attack on the freedom of the Press as guaranteed by the First Amendment of the United States Constitution."
Buckley told The Baltimore Sun Monday: "Obviously, I'm disappointed, you know? ... Is there a cutoff for tragedy? This was an attack on the press. It was an attack on freedom of speech. It's just as important as any other tragedy."
White House press secretary Sarah Sanders Tuesday said that the initial rejection of the request didn't come from the president himself.
"As soon as the president directly heard about the request made by the mayor, he asked that we reach out and verify that their mayor had made the request,” Sanders told reporters Tuesday. "And when we did, the president asked that the flags be lowered immediately. So it happened."
"I’m not sure on the process but there’s certain protocol that is followed. It was,” Sanders said. “But once the president heard about the mayor’s specific request to him he fulfilled the mayor’s request and ordered that the flags be lowered."
Trump has previously ordered flags lowered for mass shootings, including after 10 were killed at Santa Fe High School in Texas and 17 were killed at Marjory Stoneman Douglas High School in Florida.
ABC News' Chad Murray and Sarah Shales contributed to this story.