YAKIMA, Wash. — Yakima police say the arrest of three men on suspicion of loitering to obtain drugs this week illustrates why people shouldn’t give money to panhandlers.

The three men were arrested Monday at the corner of North 40th Avenue and Powerhouse Road, where they were panhandling, said Yakima police Capt. Rod Light.

People may think they’re doing a good deed by giving money to someone on the side of the road, but they may be aiding a drug habit, Light said Tuesday.

“They’re not going into McDonald’s to buy a Happy Meal after they get five dollars in their pockets,” he said.

The suspects were arrested after a woman arrested earlier in the day said she had sold them drugs, Light said.

The men — two aged 48 and one 55 — made a preliminary appearance in Yakima Municipal Court on Tuesday morning. Bail was set at $2,500 for one of the men, while the others had their bail set at $1,000 each.

According to a probable cause statement filed by police, a 39-year-old woman was arrested earlier the same day on suspicion of possessing a controlled substance — heroin — with intent to deliver after police say they saw her selling drugs to a woman in the middle of a street. Police on Tuesday did not reveal the location of that alleged transaction.

According to the affidavit, the woman said she had been selling drugs to a group of panhandlers twice a day for more than a year. Her bail was set at $50,000 in Yakima County Superior Court on Tuesday.

The city outlaws panhandlers from obstructing traffic in streets or on sidewalks, as well as intimidating, touching or pursuing people, and begging in parking lots.

The ordinance was amended in 2013 to ban pedestrians from taking things offered by people in cars near certain intersections in order to discourage panhandling.

Light said the men were not at one of the designated intersections. The closest designated intersection to where the men were is North 40th Avenue and Fruitvale Boulevard.

It is not the first time police have linked drugs to panhandling.

On Jan. 1, 2013, 56-year-old Douglas D. Budd, then one of the city’s more conspicuous panhandlers, was found dead in his car at a parking lot of the Taco Bell on East Yakima Avenue. Police also found $1,750 in cash and a half-pound of heroin in the car.

An autopsy determined that Budd, who police said was under investigation for alleged drug dealing, had died of a heroin overdose.