In 628 AD, the man proclaiming himself the Prophet Mohammed agreed to a ten-year peace treaty with the Quraish tribe of Mecca, known as the Treaty of Hudaybiyyah. At that time, the Muslims were only 1,400 strong and were too weak to conquer Mecca militarily, so Mohammed agreed to the treaty, even though many of his followers were unhappy about its terms.
Two years later, when his movement had grown to 10,000, keeping the treaty was no longer to his advantage, so he attacked Mecca and conquered it. As such, Mohammed set an unfortunate precedent within Islam.
Muslims can agree to a peace treaty (a ‘hudna‘) while they are the weaker party, but if they subsequently gain strength, by their prophet’s own example they are not duty-bound to honour it.