This verse was revealed by God to Muhammad at a time when Muslims were being attacked by the enemy from Makkah on a regular basis. The verse only allows for self-defence fighting against those who 'withdraw not from you nor give you (guarantees) of peace besides restraining their hands'. So the guarantee of a peace treaty or agreement is required for the war and fighting to completely stop.