His statement, “and he prostrates and gives the salām”: the apparent meaning of his words—may Allah have mercy on him—is that he prostrates before the salām. If this is what he means—and it is indeed his intended meaning—then this is the established position of the school of law (1).
This is because they do not hold that the prostration of forgetfulness is performed after the salām except when one gives the salām before completing the prayer. In all other cases, it is performed before the salām. However, the preponderant view, chosen by Shaykh al-Islam Ibn Taymiyyah (2), is that prostration for an addition is always performed after the salām.
Question: If a person stands for a third rak'ah in the Fajr prayer, what should he do?
Answer: He must return, even if he has already begun recitation. Likewise, if he remembers after bowing, he must return, recite the tashahhud, and give the salām; then he should perform the prostration of forgetfulness and give the salām again, according to the preponderant view that the prostration in this case is after the salām.
Question: If a person stands for a third rak'ah in a shortened prayer—that is, a traveller stands for a third rak'ah, which is an addition in the case of a traveller—must he return in this situation, or may he complete the prayer?
Answer: This depends on the ruling concerning shortening the prayer. If we say that shortening is obligatory, then he must return. This is the view of Abu Hanifah (3) and the literalist school (4). They hold that it is obligatory for the traveller to shorten the prayer, and that one who completes it where shortening is prescribed is like someone who prays eight rak'ahs for Zuhr, because he has added half of the prayer. According to the view that shortening is not obligatory, we say that he may choose between completing the prayer and returning, for if he completes it, his prayer is not invalidated; and if he returns, it is not invalidated, because he returned out of fear of making an addition.