Mayor Donald Frush, who spent most of the past month in a psychiatric ward, lost his bid for reelection today by a wide margin.

Steve Sager, a 31-year-old Democrat, outpolled the Republican mayor in 16 of 17 precincts for almost 62 percent of the vote. The final tally was 3,840 to 2,387.

Frush won only in his home precinct and there by a single vote, 272 to 271.

"This is a difficult moment for all of us, but it's one every elected official knows he must face," Frush, 54, told a group of some 75 supporters gathered at a local restaurant tonight. He immediately left the party and was not available for further comment.

But council member Ron Coss, who had acted as mayor during Frush's initially mysterious absence from City Hall, said Frush would have had an easy victory if reports about his poor health and erratic behavior had not been exaggerated.

"It's unfortunate the illness happened when it did," Coss said. "But none of us has any control over when we might get sick . . . . Mayor Frush leaves office with dignity."

Frush had said that stress and fatigue, but primarily a gum infection, had led to his hospitalization and his absence from duties since Feb. 25. He entered Johns Hopkins Hospital on Feb. 28 as a voluntary psychiatric patient -- although that fact did not become known until several days later -- and he was released last Friday.

Sager, though elated over his victory, nonetheless bristled at suggestions that the outcome might have been different had the mayor not fallen ill.

"Obviously the whole race had a lot of factors in it," Sager said. "It was different because he was gone for four weeks, but I was on a roll before he left."

Frush's absence and questions about his health turned the contest into a seemingly tight one. As a result, the mayor's race overshadowed the campaign for five council seats in Hagerstown's first at-large council election.

Predictably, both Frush and Sager, a 31-year-old developer and political newcomer, were claiming the lead early yesterday. Frush workers cited a survey giving him 60 percent of the vote, while Sager workers said their candidate was also leading by a wide margin. Frush, a former financial consultant, won 51 percent of the vote in 1981.

Frush, looking fit and energetic at a lunchtime Lions Club meeting, brushed aside questions about his health, insisting that a gum infection had been his major ailment all along.

"I am strong enough, without question," he said. "I stand on my record -- $45 million in new investments and 1,600 new jobs during my term."

Sager, who never made an issue of Frush's illness, continued to plug his themes of downtown revitalization and neighborhood development.

Outside the Bester school precinct, some voters indicated, however, that the mayor's recent condition had influenced their decision.

"I had sort of been on the fence for the longest time," said Mary Louise Saum.

"And then I heard so many stories about the mayor. I think it's going to be a close race. And I also think Hagerstown probably needs a change."