The City Council threw dog owners a bone on Tuesday by passing a bill requiring the de Blasio administration to establish a program allowing for the placement of “pet harbors” on sidewalks next to commercial establishments.

The bill, introduced by Councilman Rafael Espinal (D-Brooklyn), is partly in response to the Department of Transportation several years ago putting the kibosh on a borough-based business that began providing comfortable, climate-controlled doghouses, called DogSpots, on city sidewalks.

These shelters, which include air conditioning, allow pet owners the option of paying a small fee before going in a store to shop rather than keeping their pets tied on a leash and exposed to the elements.

The legislation is modeled after a city law allowing for coin-operated rides in front of businesses.

“Instead of supporting the innovation of a woman-owned business and a Brooklyn-manufactured business, New York City took a backwards approach by removing all pet harbors without warning,” Espinal said. “It’s our city’s job to create an environment where small businesses can thrive, and this pilot program will do just that.

“Pet harbors are win-win innovation. They’re good for business, good for dog owners, and good for dogs.”

The enclosed doggie shelters cannot be chained up or bolted to sidewalks and must be removed overnight. Multiple shelters cannot be left in front of the same establishment. Logistics on where the pet harbors will go and who will operate them still have to be ironed out.

In October, DOT Deputy Commissioner Joshua Benson testified at a council Transportation Committee hearing that the agency opposed the bill in part because of the city’s population growth.

“The demands placed on our sidewalks to accommodate larger number of pedestrians and our focus on accessibility for persons with disabilities has never been greater,” he said.