All the tribes signed the agreement to defend Medina from all external threats and live in harmony amongst themselves. Within a few years, two battles took place against the Meccan forces: first, the Battle of Badr in 624—a Muslim victory—and then a year later, when the Meccans returned to Medina, the Battle of Uhud, which ended inconclusively.