Participation in the Covenant of Hudaibiya
Hazrat Ammar bin Yasir (ra) was with the Holy Prophet (sa) during the battle of Badr, Uhud, Khandaq and all other battles. He also took part in Bait-e-Rizwan, which was the covenant taken at the time of the treaty of Hudaibiya when the Holy Prophet (sa) sent Hazrat Usman (ra) to Mecca as an ambassador.
(Usdul Ghaaba, Vol. 4, p. 124, Ammar bin Yasir, Dar-ul-Kutub-ul-Ilmiyyah, 1996, Beirut)
The disbelievers of Mecca did not let Hazrat Usman (ra) enter and false news of his martyrdom became widespread amongst Muslims at the time. Upon hearing this, the Holy Prophet (sa) gathered all the Muslims under an acacia tree. Whilst addressing everyone the Holy Prophet (sa) stated, “I wish to take an oath from all of you this day that everyone will be ready to offer their lives and no one will turn their backs and will not leave this place.” It is narrated that the companions were falling over each other in eagerness to take this oath [at the hand of the Holy Prophet (sa)]. When this oath was taking place, the Holy Prophet (sa) placed his left hand upon his right hand and stated, “This is the hand of Usman because if he was here he would not remain behind.”
(Seerat Khatam-un-Nabiyeen, Hazrat Mirza Bashir Ahmad Sahib (ra), p. 761-762)
Later, the news regard Hazrat Usman (ra) turned out to be false and he returned. However, at the time, the Muslims pledged to offer their lives that they would avenge the initially reported martyrdom or the killing of Hazrat Usman (ra) by the disbelievers who was sent as an ambassador.