Sahih Bukhari | Volume 9 | Hadith Number 215

Narrated by Sa'id bin Jubair
'Abdullah bin 'Umar came to us and we hoped that he would narrate to us a good Hadith. But before we asked him, a man got up and said to him, "O Abu 'Abdur-Rahman! Narrate to us about the battles during the time of the afflictions, as Allah says:

'And fight them until there is no more afflictions (i.e. no more worshipping of others besides Allah).'" (2:193) Ibn 'Umar said (to the man), "Do you know what is meant by afflictions? Let your mother bereave you! Muhammad used to fight against the pagans, for a Muslim was put to trial in his religion (The pagans will either kill him or chain him as a captive). His fighting was not like your fighting which is carried on for the sake of ruling."