CHICAGO — On Day 1 of what would become the longest government shutdown in the country’s history, Mary Kelly had a typically American view of the situation: She was optimistic. As an employee of the Internal Revenue Service, she had been through shutdowns before. This one would not last long, she figured.

On Day 24, weeks into her mandatory furlough, she applied for unemployment benefits.

Ten days after that, she left her home in the Chicago suburbs, rode a train downtown and joined demonstrators on a windswept Federal Plaza, her cheeks mottled pink from the cold.

“I was never scared during shutdowns in the past,” Ms. Kelly, a union officer, said during the protest on Thursday, wearing woolen gloves and clutching a sign. “But now who knows what’s going to happen?”

And then on Day 35, with no resolution seemingly in sight, she had her answer in news leaked from Washington: The shutdown was finally coming to an end.