The Messenger of Allah (s.a.w.a.) said: I swear to Allah, who has sent me as a Warner and a Guide, that the Throne of Allah did not settle, the universes did not start moving, and the heavens and the planets were not created until after Allah wrote on them:

LA ILAHA ILLALLAH.
MOHAMMADUN RASULLULLAH.
ALIYUN WALIYULLAH.

Then the Prophet explained what Allah told him, in His own voice:

Allah said, “O Mohammed”

I replied, “LABBAYK WA SAADAYK.”

Allah said: I am Mahmoud and you are Mohammad. I derived your name from mine and I made you superior to all of My creatures. Assign your brother, Ali, to be a flag for My slaves to guide them to My religion.

O Mohammad! I have made the believers the chosen ones, and I have made Ali their commander. Therefore, I curse those who command Ali and I torture those who disobey him. But those
who follow him, I will bring them closer to Me.

O Mohammad! I have made Ali the Imam of Muslims. Those who proclaim to precede him, I disgrace them. I imprison those who disobey him.

I have made Ali the master of all the successors, and I have made him the glorified leader of the believers.

He is My decisive proof on My entire creation.
Ghaayah al-Maraam p 17 Behaar al-Anwaar v 27 p 8