Sunan Abi Dawud, Hadith 965

Narrated Abdullah ibn Mas'ud: Alqamah said that Abdullah ibn Mas'ud caught hold of his hand saying that the Messenger of Allah caught hold of his (Ibn Mas'ud's) hand and taught him the tashahhud during prayer. He then narrated the (well known ) tradition (of tashahhud). This version adds: When you say this or finish this, then you have completed your prayer. If you want to stand up, then stand, and if you want to remain sitting, then remain sitting.

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

sunnah.com