A man who gained internet fame earlier this week for spending more than $500 on Girl Scout cookies was arrested Tuesday on federal drug charges.

Detric Lee McGowan posed for a photo with a group of Girl Scouts who were selling cookies outside a Bi-Lo grocery store in Mauldin, South Carolina, on Friday. He bought out their entire supply and said he wanted to help the girls get out of the cold, rainy weather.

In a social media post, Kayla Dillard, who manages cookie sales for the troop, described the exchange and included a photo of McGowan posing with two Girl Scouts. Before the post was deleted, it had been shared at least 5,000 times.

A DEA spokesman confirmed that McGowan was arrested Tuesday and was the same man who appeared in the photo that went viral. The spokesman said McGowan's arrest was unrelated to the social media post or cookie purchase.

An indictment filed on Feb. 19 states McGowan, who is also known as "Fat," is one of several suspects in an ongoing drug investigation that dates back to 2016. According to the indictment, he is charged with conspiracy to distribute heroin, cocaine and fentanyl; racketeering and conspiracy to defraud the United States. The drugs were transported from Mexico, the indictment states.

On Tuesday night, Karen Kelly, vice president of recruitment and marketing for Girl Scouts of South Carolina-Mountains to Midlands, responded to news of the arrest:

"Nobody was hurt. Nobody was threatened. We had no reason to believe that this man was anything other than one of our valuable customers that is helping Girl Scouts power awesome experiences through the Girl Scout Cookie Program. "This is now in the hands of law enforcement and of course we will cooperate with authorities."

The story of McGowan's generosity gained national attention in recent days, with publications including The Washington Post, CBS News and USA TODAY reporting on the act of kindness.

When the viral photo was taken, McGowan revealed little about himself. "The only information we got out of the man was that he owns several businesses and that he was going to take the cookies to the businesses," Dillard told CBS.

His act left a positive impression on Dillard at the time, the network reported: "That man was just a very kind, sincere and humble man who loves children."

Contributing: Elizabeth LaFleur, The Greenville News; Joel Shannon, USA TODAY