Heracles task was to clean them. This seemed to Augeas to be a long and arduous labor for Heracles to undertake. Thinking it would be totally impossible Augeas wagered Heracles a tenth of his cattle, if the huge task was finished in a single day. Without hesitation Heracles accepted Augeas' challenge, then set about working out a plan in which to do the job in a swift but thorough way. The next day Heracles started his formidable labor, not only using his great strength, but using his brain to plan this challenge.
The first part of the mammoth task was to dismantle the wall which protected the rear of the stables, and with Heracles' great strength this was an effortless job. Next he made a diversion in the two rivers which flowed close by, the Alpheus and the Peneus. After digging a canal in the direction of the stables, Heracles released their banks, and when the two rivers merged they created a surge, which, by the time they flowed through the stables, turned into a torrent. The power and also the amount of water, washed all the filth away. After the rush of water passed through the stables it not only cleansed them but cascaded on to the fields below, giving the soil life after being deprived of manure for many years.
With the task complete, Heracles sought his prize, which Augeas had promised; one tenth of all his herds. The king was infuriated by his defeat, thinking the great hero would never clean such a mountain of filth in such a short time, and refused to pay the wager. This time it was Heracles who was infuriated. However, Phyleus the son of king Augeas, thinking of the consequences of Heracles anger, affirmed the agreement and brought about an amicable settlement, which Heracles accepted.