The first occasion on which Ali ibn Abi Talib (as) offered his services to the cause of Islam was when Holy Prophet Muhammad (saw) was first ordered by Allah (SWT) to preach openly and this occasion is Dawat Al-Ashira. Before that, the Prophet (saw) was preaching under absolute secrecy.
The Holy Prophet directed Ali ibn Abi Talib (as) to prepare a meal and to invite the sons and grandsons of Abdul Muttalib. This was done and about forty of them accepted the invitation and came, only for Abu Lahab to disband the gathering before the arrival of the Prophet. Next day, a second invitation was issued and when they came, the meal was served.
Then Holy Prophet Muhammad (saw) rose and declared his sacred mission. He concluded his declaration by asking them “which one of you is willing to help me with the task?” Stating that anybody who announces his readiness to help him and bear this burden will be his brother, his successor, and the executor of his will, as Aaron was unto Moses.
The assembly remained mute with astonishment, not one venturing to accept the offered perilous office, until Ali ibn Abi Talib (as) who was the youngest at about twelve years of age, stood up and declared his allegiance and full support for the Holy Prophet Muhammad’s (saw) mission.
Holy Prophet Muhammad (saw) asked him to sit down. He (saw) repeated the same saying three times but no one except Ali (as) replied to him. The Prophet (saw) then declared: “Behold my brother and my successor and the executor of my will among you. Listen to him and obey him.”