The work, titled The Paul Juraszek monolith (after Marcus Gheeraerts), is inspired by an etching contained in the 1567 edition of the children's classic Aesop's fables.
Artist Paul Juraszek is the subject of the work.
"The painting is very different, very original," Art Gallery of NSW director Edmund Capon said.
The Archibald is renowned for winners that have sometimes ignited significant controversy, and this year's choice is expected to attract scrutiny.
"That he put 29 portraits into one painting is something of an achievement and I think it is a rather good departure from previous choices.
"So in every sense it is a most unexpected choice."
The 34-year-old artist chose to base his entry on an acquaintance, Melbourne sculptor Mr Juraszek, whose works of mythical animals are also featured in the oil painting.
"I didn't expect it at all. I was surprised to even be accepted because the picture is a bit different," Mr Wills said following his win, which earns him A$35,000.
Since its inception in 1921, the Archibald Prize has been awarded to some of Australia's most significant artists, including George Lambert, William Dobell and Brett Whiteley.
This year there were 787 entries for the prize.
In all, around 200 characters feature in the medieval-style oil painting.
The painting is described as a fictional chronology of Mr Juraszek's life, and the sculptor features in 29 portraits amid the tiny figures painted into a "landscape" portrayal of his head.
It has been described as dark and intriguing.
Mr Mills said he was surprised he was allowed to enter the portrait competition with a painting he described as a landscape portrait.
"It's not really your classic portrait," he said.
"When I first had the idea I went through the rules several times just to make sure there wasn't something that I was doing which was wrong."
Other controversial winners include Craig Ruddy's portrait of Aboriginal actor David Gulpilil, which was seen as the first winning "sketch", and is being contested in court by another artist who claims the prize is a drawing, not a portrait.
In other announcements, the Wynne prize for landscape went to John Beard's The Gap, while the Sulman Prize went to Jaiwai Shen for Peking Treaty 1901.
The Archibald packing room prize earlier went to the Michael Mucci's portrait of builder and television personality Scott Cam.
