Tired of being thrust onto the front lines of the nation’s debate over guns, Starbucks is asking customers to leave firearms behind when they are in its stores and its outdoor seating areas.

The policy change came after a shooting rampage at the Washington Navy Yard on Monday that left 13 people, including the gunman, dead. But Starbucks said its decision was not in response to that or to the shooting spree that killed 26 children and adults at the Sandy Hook Elementary School in Newtown, Conn., just days before Christmas last year.

“I’ve spent a significant amount of personal time on this issue in the last several months and I’ve seen the emotionally charged nature of this issue and how polarizing it is on both sides,” Howard Schultz, the chief executive of Starbucks, said in a telephone interview. “Nevertheless, customers in many stores have been jarred and fairly uncomfortable to see guns in our stores, not understanding the issue and feeling that guns should not be part of the Starbucks experience, especially when small kids are around.”

Under the change, baristas and other store employees will not ask customers who come in with guns in holsters, say, to leave or confront them in any way, Mr. Schultz said. No signs explaining the policy will be posted in Starbucks stores, either.