By then, the dog had been outside for 45 minutes. But hundreds of comments would soon pour in.

The first wave was, predictably, a resounding WTF.

After the outrage came calls for action. And mixed results.

But neighbors were persistent, calling the humane society, animal control, police, even the building’s concierge.

The drama — from outright horror right down to the ultimate happy ending — all played out in the comments section.

And, most importantly, it had a crucial impact on one cold, lonely dog’s life.

If we can steal a sentiment from Mahatma Gandhi and suggest the greatness of a neighborhood can be measured by how it treats animals — then this Toronto community came up epic.

This dog, whose name neighbors didn’t even know, brought out the best in them.

And that turned into the best ending. A police officer was flagged down outside the building. He investigated and ultimately brought the dog inside.

No, it’s not the happiest ending. The dog’s owner may still think it’s all right to leave dogs on 16th-story balconies in freezing conditions.

Not all right.

But one dog, at least in this neighborhood, may lead the way for many more.

A day after the incident, Todd Hofley, president of the Liberty Village Residents Association, announced a proposal for a new rule in condos: “I will bring forward a potential template for pet owners that stipulates if there is reasonable belief that their pet is in immediate and life threatening danger because of getting outside that the condominium corporation has the right to enter the unit and bring the animal inside,” he wrote on Facebook.

As for the unfortunate dog left out on the balcony?

Make sense to you? Consider making a similar proposal to your local residents’ association so no animal is left out in the cold.