PHOENIX — A federal “reverse sting’’ operation in Arizona to collar people who might be interested in robbing stash houses was “troubling” but not illegal, a U.S. appeals court ruled Wednesday.

In a divided decision, the three-judge panel of the 9th U.S. Circuit Court of Appeals said it appears that the Bureau of Alcohol, Tobacco, Firearms and Explosives essentially “recruited these defendants” not by infiltrating a suspected crew of home invasion robbers but instead by simply “trolling for targets’’ in what an informant called “a bad part of town.”

“The risk inherent in targeting such a generalized population is that the government could create criminal enterprises that would not have come into being but for the temptation of a big payday,” wrote Judge Raymond Fisher.

But Fisher said it appears that those caught were “eager to commit the fictional stash house robbery” and joined in the conspiracy “without any great inducement or pressure from the government.” And while the ATF agents took the initiative of approaching the defendants and proposing the robbery, that subsequently played “a minimal role in the crime.”

None of that convinced appellate Judge John Noonan, who said he fears the implications of Wednesday’s ruling. “Today our court gives our approval to the government tempting persons in the population at large currently engaged in innocent activity and leading them into the commission of a serious crime, which the government will then prosecute,” he wrote in his dissent.

The four arrests in 2009 were part of Operation Gideon, an undercover ATF reverse-sting operation.

ATF used a confidential informant it brought in from Miami to Phoenix specifically to assist, paying that person $100 a day.