SEATTLE — Being young and gay in this city in the 1980s, said Seattle’s mayor, Ed Murray, was all about being comfortable being out. There were shadows — AIDS was ripping through the community, and gay-bashing was common — but you didn’t have to hide the way previous generations had, and that was a powerful, exhilarating thing.

“You’re accepting who you are, you’re letting everyone else know who you are, you’re going out dancing, you hang around with people who are like you — you never thought they existed,” he said. Those years, he added, are a big part of what shaped him as a man and a politician.

But what happened back then, or did not, has now circled around to end Mr. Murray’s political career. He announced last week that he would not seek a second term in November, even though as recently as a month ago, with the local economy booming, he faced little opposition.

“The thought that I’m going to step away from this is like my life coming to an end,” Mr. Murray, 62, said during an interview in his top-floor office at City Hall.