Imam al-Bukhari (may Allah have mercy upon him) opens a chapter: “Chapter: The saying of Takbeer and Tasbeeh at the time of Amazement”

‎أَنَّ أُمَّ سَلَمَةَ ـ رضى الله عنها ـ قَالَتِ اسْتَيْقَظَ النَّبِيُّ صلى الله عليه وسلم فَقَالَ ‏”‏ سُبْحَانَ اللَّهِ مَاذَا أُنْزِلَ مِنَ الْخَزَائِنِ، وَمَاذَا أُنْزِلَ مِنَ الْفِتَنِ، مَنْ يُوقِظُ صَوَاحِبَ الْحُجَرِ ـ يُرِيدُ بِهِ أَزْوَاجَهُ ـ حَتَّى يُصَلِّينَ، رُبَّ كَاسِيَةٍ فِي الدُّنْيَا، عَارِيَةٍ فِي الآخِرَةِ ‏”‏‏.‏ وَقَالَ ابْنُ أَبِي ثَوْرٍ عَنِ ابْنِ عَبَّاسٍ، عَنْ عُمَرَ، قَالَ قُلْتُ لِلنَّبِيِّ صلى الله عليه وسلم طَلَّقْتَ نِسَاءَكَ قَالَ ‏”‏ لاَ ‏”‏‏.‏ قُلْتُ اللَّهُ أَكْبَرُ‏.

Narrated Um Salama:
(One night) the Prophet (ﷺ) woke up and said, “Subhan Allah ! How many treasures have been (disclosed) sent down! And how many afflictions have been descended! Who will go and wake the sleeping lady occupants up of these dwellings (for praying)?” (He meant by this his wives.) The Prophet (ﷺ) added, “A well-dressed soul (person) in this world may be naked in the “Hereafter.” `Umar said, “I asked the Prophet, ‘Have you divorced your wives?’ He said, ‘No.’ I said, ‘Allahu Akbar.’ ” [Saheeh al-Bukhari (no. 6218)]

Hafidh Ibn Hajar (may Allah have mercy upon him) quotes Ibn al-Battal (may Allah have mercy upon him) saying:

“at-Tasbeeh and at-Takbeer both mean venerating Allah and transcending Him from evil. Using that during the time of amazement and a great affair is something good. In it is the training of the tongue to remember Allah, the Exalted. This advice is good. It is as if al-Bukhari is indicating a refutation against the one who prevents that” [Fath ul-Baari (10/614)]

And:

‎عَنْ عَبْدِ اللَّهِ، قَالَ قَالَ لَنَا رَسُولُ اللَّهِ صلى الله عليه وسلم ‏”‏ أَمَا تَرْضَوْنَ أَنْ تَكُونُوا رُبُعَ أَهْلِ الْجَنَّةِ ‏”‏ قَالَ فَكَبَّرْنَا ‏.‏ ثُمَّ قَالَ ‏”‏ أَمَا تَرْضَوْنَ أَنْ تَكُونُوا ثُلُثَ أَهْلِ الْجَنَّةِ ‏”‏ قَالَ فَكَبَّرْنَا ‏.‏ ثُمَّ قَالَ ‏”‏ إِنِّي لأَرْجُو أَنْ تَكُونُوا شَطْرَ أَهْلِ الْجَنَّةِ وَسَأُخْبِرُكُمْ عَنْ ذَلِكَ مَا الْمُسْلِمُونَ فِي الْكُفَّارِ إِلاَّ كَشَعْرَةٍ بَيْضَاءَ فِي ثَوْرٍ أَسْوَدَ أَوْ كَشَعْرَةٍ سَوْدَاءَ فِي ثَوْرٍ أَبْيَضَ

Abdullah bin Mas’ud reported: The Messenger of Allah (ﷺ) addressing us said: Aren’t you pleased that you should constitute one-fourth of the inhabitants of Paradise? He (the narrator) said: We said: Allahu Akbar (Allah is the Greatest). He, then, again said: Aren’t you pleased that you should constitute one-third of the inhabitants of Paradise? He (the narrator) said: Allahu Akbar (Allah is the Greatest) and he (the Holy Prophet) then again said: I hope that you would constitute half of the inhabitants of Paradise and I shall explain to you its (reason). The believers among the unbelievers would not be more than a white hair on (the body of a) black ox or a black hair on (the body of a) white ox” [Muslim no. 221]

Imam an-Nawawi (may Allah have mercy upon him) said in explanation of this Hadith:”As for their Takbeer, then it is their happiness with this great glad tiding…” [Sharh Saheeh Muslim (2/98)]

Mulla Ali Qaari (may Allah have mercy upon him) said in explanation of similar Hadith: “Takbeer due to amazement, complete happiness, glad tiding, and a great affair” [Mirqaatul-Mafaateeh (10/199)]

Also:

‎عَنْ عَبْدِ اللَّهِ بْنِ بُدَيْلٍ، بِإِسْنَادِهِ نَحْوَهُ قَالَ فَبَيْنَمَا هُوَ مُعْتَكِفٌ إِذْ كَبَّرَ النَّاسُ فَقَالَ مَا هَذَا يَا عَبْدَ اللَّهِ قَالَ سَبْىُ هَوَازِنَ أَعْتَقَهُمُ النَّبِيُّ صلى الله عليه وسلم قَالَ وَتِلْكَ الْجَارِيَةُ ‏.‏ فَأَرْسَلَهَا مَعَهُمْ

On the authority of Abdullah ibn Budayl through a different chain of narrators in a similar way.

This version adds: While he (Umar) was observing i’tikaf (in the sacred mosque), the people uttered (loudly): “Allah is most great.” He said: What is this, Abdullah? He said: These are the captives of the Hawazin whom the Messenger of Allah (ﷺ) has set free. He said: This slave-girl too? He sent her along with them [Saheeh Sunan Abi Dawood no. 2475]

Shaikh Abdul-Muhsin al-‘Abbad (may Allah preserve him) said: “That is: they said Takbeer out of joy and it is during the time of happiness. This occurred with the Companions (may Allah be pleased with them). It comes in the Ahaadith that the Prophet (ﷺ) said to them: “I hope you are one-third of the People of Jannah. He said: They said: Takbeer”. That is: out of joy and happiness. This indicates that when something pleasing comes, that it is legislated to make Takbeer. It is not correct to clap, like it occurs from a lot of people in this time period” [Sharh Sunan Abi Dawood no. 288]

Also the Prophet (ﷺ) said Allahu Akbar when Umm Sulaym (may Allah be pleased with her) gave birth to her son Abdullah. It comes:

‎ قال فقلت يا رسول الله ولدت أم سليم، قال الله أكبر ما ولدت ؟ قلت غلاما، قال الحمد لله

“I said: O Messenger of Allah, Umm Sulaym gave birth. He said: “Allahu Akbar! What did she give birth to”? I (Anas) said: “A boy”. He said: “All praise is due to Allah…”[Reported by Ahmad in his Musnad (no. 12865) and graded Saheeh by Shu’aib al-Arna’oot in his checking of the book (20/230)]

There are other proofs for this as well.

And Allah Knows Best

Faisal bin Abdul Qaadir bin Hassan
Abu Sulaymaan