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.

Watford, who were unable to fulfil last weekend's Women's FA Cup third-round tie at Doncaster, now say their future is secure after meetings on Monday.
The Women's Super League Two club begin their Spring Series campaign on Sunday against Aston Villa Ladies.
"It's been a time of much transition and change," general manager Ellie Kemp told Watford's club website.
"However we believe we're now on a very firm footing with Keith leading our coaching set-up."
A club statement added that Watford conceded their cup tie against the Belles "in order to ensure necessary preparations were fully in place ahead of the start of the league fixture programme".
Boanas, 57, led Charlton Ladies to three successive FA Women's Cup finals, winning the trophy in 2005, before a brief spell as Millwall Lionesses boss.
He also won the FA Women's Premier League Cup in 2004 and 2006 during his seven-year spell with Charlton.
Watford's former head coach Katie Rowson resigned in August and, prior to Boanas' appointment, no formal replacement had been announced for a first-team boss.
Watford pulled out of last Sunday's scheduled Women's FA Cup third-round tie at Doncaster Rovers Belles the day before the game, with the Yorkshire side being awarded a bye.
An emergency meeting is understood to have been held on Monday between club officials from the men's and ladies' arms of the club.
Prior to Boanas' appointment being announced, a Football Association spokesperson said: "We have contacted Watford about their involvement in the FA WSL Spring Series."
The Lady Hornets - who were founded in 1970 - had finished seventh in WSL 2 in 2014 - the first season after the WSL was expanded to include a second tier.
They have finished bottom of the second tier for the past two seasons, winning just three times in 36 league games.
On 11 January, the club announced a change in their regular venue for home matches, leaving Berkhamsted FC to play at Kings Langley FC's ground, known as Gaywood Park.
Kemp added: "The players will be energised and ready for the challenges that lay ahead. We want to be a really competitive team and there's no reason to believe we can't achieve that."
Scientists have found out that ants began farming millions of years before humans did.
[NEXT_CONCEPT]
Former Charlton and Estonia Women's boss Keith Boanas has been appointed as the new head coach of Watford Ladies.