Sayyidah Aishah (may Allah be pleased with her) says that the Messenger of Allah (peace and blessings be upon him) said: "Avert the hadd punishments as far as you are able. If you find a way out for the Muslims, then let them go, for it is better for the ruler to err in pardoning than to err in punishing."
The most authentic of the narrations on this from the Companions is the narration of Asim, from Abu Wa'il, from Abdullah bin Mas'ud, as his own statement.
Hadith Referenceالسنن الكبرى للبيهقي / كتاب السير / 18294