Several scenarios may apply to holding a second congregational prayer in the mosque, some of which are not allowed and some are permissible.
The kind which we should agree is forbidden is when this second congregational prayer is held with prior agreement among these people, such as if they agree to come to the mosque after the imam has finished praying, then they pray in congregation. Similarly forbidden is when this second prayer in congregation is something that happens regularly in the mosque, in a systematic fashion, such as if it is said for example: The first congregational prayer will be held at such and such a time, and the second will be held at such and such a time, and this is something that is done regularly.
There is no dispute that these two scenarios are haraam, because they are causing disunity among the Muslims and discouraging the people from attending the first congregational prayer.
But if the second congregational prayer is held in the mosque on an occasional basis without any prior agreement, such as if a group of people enters the mosque after the imam has finished the prayer and they pray in congregation, then there is a difference of opinion among the scholars concerning this. The correct view is that it is permissible and is in fact mustahabb, because it brings the reward of praying in congregation.
Shaykh Ibn ‘Uthaymeen (may Allaah have mercy on him) said, describing the scenarios of a second congregational prayer in the mosque: As for the first scenario, if there are always two congregations in the mosque, the first congregation and the second congregation, undoubtedly this is makrooh, if not haraam, because it is bid’ah (an innovation), and it was unknown at the time of the Prophet (peace and blessings of Allaah be upon him) and his companions.
Another example is what was known in al-Masjid al-Haraam before the Saudi government took charge of it, where there were four congregations, each of which had an imam: a Hanbali imam who led the Hanbalis in prayer, a Shaafa’i imam who led the Shaafa’is, a Maaliki imam who led the Maalikis and a Hanafi imam who led the Hanafis. They said: This is the maqaam for the Shaafa’i, this is the maqaam for the Maaliki, this is the maqaam for the Hanafi and this is the maqaam for the Hanbali.
But when King ‘Abd al-‘Azeez (may Allaah reward him with good) entered Makkah, he said: This is dividing the ummah, i.e., the Muslim ummah is being divided in one mosque, and this is not permissible. So he united them behind one imam, and this was one of his good deeds and virtues (may Allaah have mercy on him).
What he referred to is one of the forbidden things, which is dividing the ummah.
Moreover, it promotes laziness, because people will say: So long as there is a second congregational prayer, we will wait until the second group comes, and the people will turn away from attending the first congregational prayer with the regular imam.
Then he mentioned the second scenario and said:
As for the second scenario, which is when it happens without prior agreement, i.e., the regular imam is the one who leads the congregational prayer in the mosque, but sometimes two or three or more men stay away for a valid excuse, then this is a matter concerning which the scholars differed.
Some of the scholars say that the congregational prayer should not be repeated, i.e., they should pray individually.
Some of them say that it should be repeated, and this is the correct view, and it is the view of the Hanbalis. The evidence for that is:
Firstly: the hadeeth of Ubayy ibn Ka’b, according to which the Prophet (peace and blessings of Allaah be upon him) said: “For a man to pray with another man is better than his praying alone, and for him to pray with two other men is better than his praying with one other man. The more men there are, the dearer it is to Allaah.” Narrated by Abu Dawood (554) and al-Nasaa’i (843). This clearly shows that it is better for a man to pray with another man than to pray alone. If we say that there should not be another congregational prayer, this means that we are favouring the less-favoured choice (i.e., praying alone), and this is contrary to the text.
Secondly: One day the Messenger (peace and blessings of Allaah be upon him) was sitting with his companions when a man came in after the prayer had finished, and he said: “Who will give charity to this man and pray with him?” One of the people got up and prayed with the man. Narrated by al-Tirmidhi (220). This clearly shows that the congregational prayer may be repeated after the regular congregation, because the Prophet (peace and blessings of Allaah be upon him) encouraged someone to pray with this man. If someone says that this was charity, but when two men pray in the mosque when they have missed the prayer, the prayer of each of them is obligatory, it may be said in response that if Prophet (peace and blessings of Allaah be upon him) enjoined doing an act of charity, and one who had already prayed was commanded to pray with this man, how can one who has not prayed not be commanded to pray with this man?
The third scenario is when the mosque is in a marketplace or on a highway and the like. If it is a marketplace mosque where people come and go, and two or three or ten men come and pray and then leave, as happens in the mosques that exist in some marketplaces, then it is not makrooh to repeat the congregational prayer in this case. One of the scholars said: There is consensus and there is no difference of opinion on this point, because this mosque is a place where various groups come and go, and there is no regular imam behind whom the people may unite. End quote from al-Sharh al-Mumti’ (4/227-231).
What we advise our brothers to do is to reconcile and strive to unite and put an end to discord and disunity, and do away with selfishness. They should adhere to this ritual which is one of the causes of unity and harmony; how can they make it a means of dispute and disunity?
We have an example in ‘Abd-Allaah ibn Mas’ood (may Allaah be pleased with him), who criticized ‘Uthmaan (may Allaah be pleased with him) for offering the prayer in full in Mina, but despite that he also offered the prayer in full. When he was asked about that he said: “Disunity is evil.” Narrated by Abu Dawood (1960).
Another indication of the importance of striving to reconcile people and bring them together is that a number of scholars stated that it is permissible for the imam to omit some of the sunnahs in order to unite the congregation, as Shaykh al-Islam Ibn Taymiyah (may Allaah have mercy on him) said: If the imam thinks that something is mustahabb, but the people praying behind him do not regard it as mustahabb, and he omits it for the sake of unity and harmony, that is better. An example of that is Witr, concerning which the scholars have three views: (1) that it can only be done with three continuous rak’ahs, like Maghrib, as is the view of the people of Iraq; (2) that it can only be done with one rak’ah separate from those that precede it, as is the view of those among the people of the Hijaaz who held this view; (3) that both are permissible, as is the view of al-Shaafa’i, Ahmad and others, and this is the correct view, even though they prefer that it should be done with one separate rak’ah. If the imam thinks that it should be done with one separate rak’ah, but the members of the congregation think that Witr should be prayed like Maghrib, and he concurs with them in order to bring about unity, that is better, as the Prophet (peace and blessings of Allaah be upon him) said to ‘Aa’ishah: “Were it not that your people have only recently left Jaahiliyyah behind, I would have demolished the Ka’bah and levelled it to the ground, and rebuilt it with two doors, one door for the people to enter and another door for them to exit.” So he refrained from doing that which was better in his view, so as not to alienate the people. Similarly, if a man thinks that reciting Bismillaah out loud is correct, but he leads in prayer people who hold a different view, or vice versa, and he concurs with them, that is better. End quote from al-Fataawa al-Kubra (2/118).
We ask Allaah to set our affairs and those of all the Muslims straight.
And Allaah knows best.