"Our thoughts and prayers as a Nation are with the service members killed last week in Chattanooga. We honor their service. We offer our gratitude to the police officers and first responders who stopped the rampage and saved lives," the president said in a statement Tuesday. "We draw strength from yet another American community that has come together with an unmistakable message to those who would try and do us harm: We do not give in to fear. You cannot divide us."

Chattanooga mourns slain service members

The flags will fly at half-staff until July 25 at the White House, on all public buildings and grounds at home and abroad and at all military posts, naval stations and naval vessels.

The move comes as the president was facing rising pressure from Republicans to lower the flag. House Speaker John Boehner ordered flags to half-staff at the U.S. Capitol Tuesday morning and said there would be a moment of silence on the House floor later that day. Several other Republican governors, including Tennessee Gov. Bill Haslam, have done the same.

House Armed Services Committee Chairman Mac Thornberry, R-Texas, issued a statement Tuesday saying the president should follow Boehner and Haslam's actions, saying they were "doing the right thing to honor those casualties."