Peter Foley/Bloomberg via Getty Images(NEW YORK) -- A Texas woman is facing a felony retaliation charge after she allegedly posted a photograph of an undercover narcotics officer on Facebook and identified his job.

Melissa Walthall, 30, told Mesquite police she saw the photograph on a flyer three weeks earlier and posted it because her friend was upset with the officer's testimony on drug charges, according to a federal affidavit.

On Oct. 7, one of Walthall's friends told police a photograph of a man appeared in her newsfeed and was labeled "Undercover Mesquite Narcotics" with the caption "Anyone know this b****."

Investigators checked Walthall's Facebook page and issued a warrant for her arrest on harassment charges after they deemed her post a "viable threat to that officer's safety," the affidavit stated.

Walthall refused to identify her friend. However a computer search led police to George Pickens.

Pickens, 34, told investigators he and his brother, Bobby Stedham, began researching the undercover officer online and found his Facebook page and photograph. They used the photo to make flyers featuring the officer with the intent to display them "like garage sale signs," according to the affidavit.

"It's a very dangerous situation," said Kevin Lawrence, executive director of the Texas Municipal Police Association.

"If you're trying to infiltrate a cartel, a drug ring, a gang, one of the keys is people have to believe you're not an officer. Anything that hints at tying you to law enforcement is very dangerous," he said.

Stedham, 26, has also been charged with retaliation. Pickens faces drugs and weapons charges after authorities found 28.6 grams of methamphetamine in his room and an unregistered, sawed-off shotgun.

Lawrence said his group advises members of law enforcement to be very cautious about social media, if they must use it at all.

"There are too many opportunities for bad things to happen in exchange for very little up side," he said. "But the fact the officer shouldn't have had a Facebook doesn't excuse her [Walthall] either."