Ali (a.s) was the cousin and son-in-law of the Prophet Muhammad. He played an important role early in Islam and acted as a scribe for Muhammad. After Muhammad's death, Ali asserted his right as successor but was denied by some. Ali served as the fourth caliph and faced opposition from Muawiyah. Ali authored many works including Nahjul Balagha, which contains his sermons, letters, and sayings.