Whenever the Messenger of Allah ﷺ appointed a commander over an army or expedition, he would personally instruct him to fear Allah and to treat the Muslims with him well. Then he would say, "...And when you besiege the people of a fortress and they wish to surrender to you on Allah's judgment, do not grant them surrender on Allah's judgment. Rather, let them surrender on your own judgment, for you do not know whether you will arrive at Allah's true ruling concerning them or not."
كان رسول الله ﷺ إذا أمرأميرا على جيش أو سرية، أوصاه في خاصته بتقوى الله ومن معه من المسلمين خيرا، ثم قال:… وإذا حاصرت أهل حصن فأرادوك أن تنزلهم على حكم الله، فلا تنزلهم على حكم الله، ولكن أنزلهم على حكمك، فإنك لا تدري أتصيب حكم الله فيهم أم لا.
Muslim narrated it in the Book of Jihad and Expeditions (1731: 2, 3) via Sufyan (that is, Thawri), from Alqama bin Marthad, from Sulayman bin Burayda, from his father, and he related it.