Before you start squashing the little pests, play detective for a few minutes. Try to figure out what’s attracting the ants by watching where they’re going and what they’re doing. This will help you decide which of the methods below to use to banish them from your lemon trees.

Why Ants Are Attracted to Lemon Trees

You may notice ants crawling randomly around your plants in search of food, or they may be a little more goal-focused. Ants are most likely to show up in your citrus tree when aphids or scale bugs are already there. These sap-sucking pests produce honeydew, a sweet liquid that ants eat. In fact, the ants so prize this food source that they will “herd” the aphids from leaf to leaf and protect them from predators. Some ants are attracted to the nectar in citrus blossoms, thus acting as pollinators. However, these visitors aren’t always benign: Red fire ants sometimes attack lemon trees, destroying flowers and chewing through the bark to get at the sap. They may even gnaw the bark all the way around the trunk, which will eventually kill the tree.

The Best Ways to Eliminate Ants on Citrus Trees

Attack the Aphids and Scale Bugs

If your lemon tree has aphids or scale bugs, you’ll need to wipe out these pests first to discourage the ants they attract. Look closely at the undersides of the leaves for tiny white, green, or black insects (aphids) or small brown bumps that don’t move (scale insects). If you spot them on just a few leaves, snip the affected parts off and toss them in the garbage, not the compost bin, since most piles don’t get hot enough to kill pests. If you’re dealing with a more widespread aphid infestation, blast the entire tree with a hard spray of water from your hose to knock off the pests. For scale bugs, smother them with horticultural oil ($25, Walmart), which also works on aphids. Repeat the treatments every three weeks until the insects are gone.

Drench Red Fire Ants

Water also can come to the rescue when dealing with red fire ants attacking your lemon tree. Find the nest and pour about three gallons of boiling water on it. If the nest isn’t completely destroyed by this treatment (or if there are plants around that would be harmed by the hot water), use an insecticide drench ($28, Lowe’s) on the nest. Once it soaks in, this will wipe out the colony.

How to Keep Ants Off Lemon Trees

Prune Wisely

Keep the branches high off the ground, so the ants have a harder time climbing your lemon tree. Prune so that the lowest branches are 30 inches from the soil, if possible. Cut away branches that touch nearby shrubs or fences if the ants are using them as an on-ramp.

Protect the Trunk

Block the ants’ passage up the tree trunk by placing a tree wrap ($10, Walmart) around the trunk. Cover a few inches of the trunk with the wrap, starting low to the ground, but high enough that your sprinkler won’t splash it. Then paint a sticky substance such as Tanglefoot Tangle-Trap ($15, Walmart) on the wrap, which will catch any ants that try to cross the barrier. Check the tree every week to make sure ants aren’t sneaking under and eluding the sticky trap. Reapply the goopy stuff if it’s covered with dead ants.

Keep Your Citrus Trees Well-Watered

Your citrus tree is more likely to be attacked by pests if it doesn’t have enough water. Keep your citrus tree healthy by making sure it gets at least an inch of water a week. If you have a potted lemon tree, water whenever the soil feels dry to the touch.