In 628 the Meccan tribe of Quraysh and the Muslim community in Medina signed a 10-year truce called the Treaty of Hudaybiyyah.
In 630, this truce was broken when the Banu Bakr, allies of the Quraysh, attacked the Banu Khuza'a, who had recently become allies of the Muslims.
After the incident, Quraysh sent a delegation to Muhammad, petitioning to maintain the treaty with the Muslims and offering material compensation. The Muslim forces had gathered in strength to settle account with Quraysh and for the final attack and the opening of Mecca.