(CNN) A man who was praised for buying $540 in cookies so two Girl Scouts could escape the cold has been arrested on federal drug charges.

Detric McGowan went viral over the weekend after he spent $540 to buy the cookies from two girls so they didn't have to stand outside a grocery store in Greenville, South Carolina.

A picture of McGowan posing with the two girls was posted on Facebook by the girls' cookie manager and shared thousands of times. The story even picked up national coverage, including from CNN.

The purchase happened Friday.

Read More