A team from America have looked at how ants have evolved and found that the insects had complex underground farms, growing different types of fungi.
Not only that, the ants had taken fungus from its natural environment to nests in much drier climates.
The fungus couldn't survive without the ants so it is a very early example of agriculture.
Agriculture is what we call the practice of farming. Such as preparing soil for growing crops and raising animals for food and other products such as wool.
Dr Ted Schultz who specialises in ants and works at the Museum of Natural History said that "Ants have established a form of agriculture that provides all the nourishment needed for their societies using a single crop that is resistant to disease, pests and droughts at a scale and level of efficiency that rivals human agriculture."
There are many species of farmer ant, over 250 have been found in tropical forests, deserts and grasslands in the Americas and the Caribbean.
Scientists have found out that ants began farming millions of years before humans did.