As the Yorkshire-wide heatwave blazed on yesterday, the dogs were spotted in the car parked by York Hospital by officers from North Yorkshire Police's York City Centre team.
The officers, a Police Constable and Police Community Support Officer, smashed the car's window to retrieve the animals and called the York branch of the RSPCA, which is set to prosecute the owner.
Tweets posted on the policing team's account said: "#PC1810 and PCSO 3680 have just rescued two dogs from a vehicle where the owners had left them for over half an hour in a car in the blazing hot sun. The window was smashed and the owners will be prosecuted by @RSPCAYORK. There is no excuse for this, I am utterly appalled.
"Officers were in that car for thirty seconds and were struggling to breathe so goodness knows what these poor animals were going through. DO NOT LEAVE YOUR DOG IN A HOT CAR ON A SUNNY DAY! How many warnings do you need? @RSPCAYORK thank you for your prompt attendance. #PC1810"
The tweet has since been retweeted hundreds of times and has attracted dozens of comments from concerned dog lovers.
Nicola Newman said: "THANK YOU for helping these poor dogs. I am sick to the back teeth of seeing cars with dogs left in them."
Jean Jenkins added: "It is appalling. People like this should not be allowed to keep animals of any type."
Jake Freeman said: "How terrible to take your dogs with you to the york hospital on a day like this, should have kept them at home with plenty of water and shelter."
The officers later said they were 'overwhelmed' by the response to their post.
A tweet on the @NPTYorkcity account said: "I’m overwhelmed by this response from you all. Let’s keep retweeting this message. So far 14000 people have seen the tweet. Keep it going and #RT please."