BANGKOK — A man offering “free hugs” to comfort mourners was forced to apologize after an image of a woman doing the same exploded over social media during the past two days, inviting the military regime Tuesday to condemn it as inappropriate.

Teerawat Pinpanichakarn stepped forward Monday to claim responsibility for the unexpected “free hugs” drama, which he said began in Siam Square on Oct. 17, three days after the death of His Majesty King Bhumibol. Saying it met a positive response, he continued offering free hugs throughout the city until Sunday, when at the Sanam Luang, a woman joined him for about three minutes.

It was the image of the unidentified woman offering hugs to strangers that set the internet aflame and prompted the authorities to decry it as inappropriate.

Saying Teerawat had “good intentions but inappropriate results,” junta spokesman Piyapong Klinpan took exception to a woman offering hugs, suggesting such affection could be considered sexual.

“A hug is not always a sign of love. Love flows from the heart. This activity would be different if an elderly person or a man was doing it – instead of a woman,” Col. Piyapong said.

Teerawat said he was called in by authorities who asked him why he was “including the King” in his activity. He said he was trying to spread a message of love in response to episodes of intolerance.

“Do you remember the witch hunting about wearing black? That’s creating division,” he wrote on Facebook later Sunday. “Let’s do what the King taught us and love each other instead.”

Teerawat insisted he had no ulterior motives and apologized for any discomfort caused. He also urged the public not to hound the woman seen in the photo.

“This was my idea, and I take responsibility for my actions,” he said. “She has nothing to do with this.”

Teerawat said he and some friends were inspired by the the Free Hugs social movement started by Australian Juan Mann.

“I wanted to comfort Thais in this time of mourning and help encourage everyone,” he said.

That didn’t satisfy military government spokesman Sansern Kaewkamnerd. Sansern on Tuesday dismissed the behavior as un-Thai.

“Is the activity appropriate to our glorious Thai culture and the current mourning period?” Lt. Gen. Sansern said. “Instead of offering free hugs, youths should hold other, more appropriate activities.”

Col. Piyapong advised youth to “give love” in other ways, such as with free food or inhalers.