It was narrated that ‘Ali (رضي الله عنه) said:
When al-Hasan was born, I named him Hamzah. When al-Husain was born, I named him after his paternal uncle Ja`far. Then the Messenger of Allah (ﷺ) called me and said: `I have been commanded to change the names of these two.` I said: Allah and His Messenger know best. And he named them Hasan and Husain. (رضي الله عنهما)