Ben Sowards, from Utah, US, was told before he went to pick his six-year-old daughter Valerie up that she had wet herself at school.
So before he left, he made a wet patch that was easily seen on his light grey trousers to match Valerie.
Sowards’ older daughter, Lucinda, shared photos of the pair at school on 14 April.
“My little sis had an accident today and this is how my dad left to pick her up so she wouldn’t feel sad/embarrassed,” Valerie’s older sister tweeted.
Speaking to Today, the dad said: “I walked into the school and walked up next to Valerie, who was sitting looking down at the floor.
“I put my arm around her and I said, ‘Valerie, can I have your backpack? I need to cover up this accident’.
“She just looked at me with the perfect look - just disbelief - and we started laughing.”
The photos were retweeted more than 60,000 times in one week and had more than 250,000 likes. Twitter uses praised the dad for his spot-on parenting move.