Shafa'a

Shafa'a (, "intercession") in Islam is the act of pleading to God by an intimate friend of God (a Muslim saint) for forgiveness of a believing sinner. 
The word "Shafa'ah" is taken from "shaf " () which means "even" as opposed to "odd". The interceder, therefore, adds his own recommendation to that of petitioner so that there are two individuals -- an even number -- pleading for forgiveness. The prestige of the intercessor strengthens the otherwise weak plea of the sinner. 
Accordingly, "Shafa'ah" is a form of prayer to God by one who is near to Him on behalf of a member of the believing community seeking deliverance from eternal damnation (though not necessarily from temporary punishment).
Controversies concerning "Shafa'ah" have arisen over who may intercede with God. Some maintain that supporters of Wahhabism deny the Shafa’ah of Muhammad, while at least some supporters insist they only oppose the seeking of Shafa’ah from "the dead and the like". Another issue is whether using holy persons as mediators to God "with a specific request in mind" is halal (allowed) or "an unconscionable innovation ("bidʻah"), turning Muslims into idolaters".
Another issue is whether focusing on intercession runs the risk of emboldening people to committing sins, it should be considered as a ray of hope which lead sinners to the right path after they have wronged themselves. 
None of the 29 mentions of "Shafa'ah" on the Day of Judgement in the Quran specifically include Muhammad or "the office of prophethood". Nonetheless belief in the intercession of Muhammad is a doctrine of both Sunnis and Shiites supported by hadith. Shia also extend the idea of mediation to include The Twelve Imams and other "intimate friends of God" (Awliya).
Popular belief among Muslims is that "all but the most sinful" Muslims will be saved by Muḥammad's intercession and God's mercy at "the final time".
Intercession in the Quran and hadith.
In the Quran.
Verses in the Quran which addresses intercession can be grouped in three different categories. 
The first type deny intercession entirely; among which are the verses which talk about how 
A second type states there will be intercession but only by God. These verses state that 
A third type state there will be intercession on behalf of sinners by some sorts of people depending on His pleasure. The verses which ends with phrases like 
The verses 19: 87 34: 23 53: 26 are also covering the same notion.
Inter-relationship.
The first type of the above-mentioned verses totally rejects intercession while the second type reserves it for God only. The third type, however, state that others too may intercede with God's permission. (The Wahhabism movement accepts the belief in intercessor by Allah, but condemns as an unbeliever anyone who believes in intercession of anyone other than God.) However, according to Tabataba'i (1903–1981) the Quran is known for first rejecting any virtue or perfection for anyone other than God; but then confirming that same virtue for others depending on His permission and pleasure. To prove his view, Tabataba'i puts forward the following similar verse in which first (in the first verse) the Quran says only God knows unseen, then (in the second verse) the Quran confirms it for others too: "And with Him are the keys of the unseen, does not know it any except He". "[S]o He does not reveal His secrets to any, except to him whom He chooses of an apostle".
The following is another example of this kind made by Tabataba'i: "… they shall be in the fire; […] abiding therein so long as the heavens and the earth endure, except as your Lord please; surely your Lord is the (mighty) doer of what He intends. And as to those who are made happy, they shall be in the garden, abiding in it as long as the heavens and the earth endure, except as your Lord please; a gift which shall never be cut off".
Intercession in hadith.
The principle of intercession is mentioned in some of Muhammad's sayings when he said for example: "I have received five gifts from God, [one of which] is that of intercession, which I have in store for my community. My intercession is for those who have not associated any partner with God."
In another situation the prophet says "My intercession is especially for the perpetrators of major sins in my community." According to Tabatabaie the reason why "major sins" are mentioned in this Hadith is that the Quran has already promised that if people avoid major sins, God would forgive their minor sins (Qur'an, 4: 31) so that there would be no need for the minor sins to be forgiven.
It is also related by Ibn Abbas from the prophet who said the believers, as well, could intercede for their brothers, which is a kind of praying on one's behalf. It says: "If a Muslim dies, and forty believers in the unity of God pray for him, God accepts their intercession on his behalf."
Intercession in creeds.
The basis for the "popular belief" that "all but the most sinful" will be saved from hellfire by Muḥammad's intercession and God's mercy at the final time, is a story from "the creeds (aqidah) of al-Ash'arī, al Nasafī, al-Tahāwī, and Abū Ḥanīfa": 
Then the Prophet says to God, please hasten the judgment for my community. He continues to intercede until he is given a document for those who were sent to the Fire. The possessor of the place where the Fire is kept will say, O Muhammad, you did not leave behind any fuel for the anger of your Lord?
The "fuel for the anger of your Lord" being anyone (Muslim) to be burned in "the Fire of God's avenging justice". Their lack meaning no one is going to hell.
Objections against intercession and responses.
Wahhabis assume the intercession of God on the Day of Resurrection as positive, and that of the Prophets and other awliya as negative. In order to get closer to God, Wahhabis argue, it is a kind of polytheism to abandons the "nearer means" (God) and resorts to a "remote means" (other than God).
They quote the following verse to prove that one should not resort to intercession of other than God even if he is the prophet of Islam, since, they say, the requisite of Tawhid is that one should ask only God for help:
In response to this objection it is said that "beside Allah" in this verse refers to the idols not human beings. 
According to Tabataba'i the reality of seeking intercession is nothing more than the request for prayers from the intercessor, an examples of which, as related in the Quran, is the story of the sons of Jacob when they asked their father to implore God's forgiveness of them. Jacob accepted their petition and promised to do so at the appointed time.
According to the Quran, being averse to asking prophet to seek forgiveness for one, (i.e. being averse to intercession) is considered an act of hypocrisy and pride, while making this request is a sign of humility and faith:
"if, when they had wronged themselves, they had but come unto thee (Muhammad) and asked forgiveness of God, and the Messenger had sought forgiveness for them, they would have found God Forgiving, Merciful." The same notion has been said in the verse 63: 5.
It has also been objected that had Allah promised intercession, or had His prophets brought this message to their nations, the people would have been emboldened to disobey the commandments of God, and it would have defeated the whole purpose behind the institutions of prophethood and religion. To show his aversion to this argument, Tabataba'i asks "What they would say about the verse which says 'Surely Allãh does not forgive that any thing should be associated with Him, and forgives what is besides that to whomsoever He pleases' because 'in cases of repentance even polytheism may be forgiven'."
Intercessors.
According to the Quran the prophets and angels have the authority to intercede on behalf of believing members of Islamic community. According to Shiite Imams and other intimate friends of God could also intercede on permission of God.
Prophets.
Intercession of Muhammad on the day of resurrection is accepted by both Sunnis and Shiites. Without His permission, however, no intercession is accepted.
The following verse which is concerning the sons of Jacob show how, even in their lifetime, the prophets had the authority to intercede on behalf of those who repent. (The brothers of Joseph) said, "O our father! Ask forgiveness from Allah for our sins. Indeed, we have been sinners." He said, 'I will ask my Lord for forgiveness for you.' Verily, He, and only He, is the Oft-Forgiving, Most Merciful". In another occasion the Quran addresses those who have been unjust to themselves stating if they had come to Muhammad and "begged Allah’s forgiveness, and the Messenger had begged forgiveness for them—indeed they would have found Allah All-Forgiving, Most Merciful."
Muhammad himself has confirmed this kind of intercession in many occasions, one of which was when he said he would intercede on the Day of Judgment "for whoever has faith in his heart". The first documentary statement of Muhammad's eschatological role appears in the inscriptions of the Dome of the Rock in Jerusalem, completed in 72/691-692.
Angels.
Angels too have the ability to intercede on permission of God as it could be inferred from the verse which says angels' intercession is of no use "except after God giveth leave to whom He chooseth and accepteth!" In other places it is pointed out that angels "ask forgiveness for those on earth" and for "those who believe".
Imams (Shiite view).
Belief in the intercession of Muhammad, confirmed by both Sunnis and Shiites, extended among the Shiite to include the Imams, too. For Shiites, salvation was based on true belief but this was largely "measured by attachment to Ali and Ahl al-Bayt." In a Shiite tradition attributed to Muhammad Muhammad al-Baqir Walayah toward Ali is viewed as the essential criterion of both faith and salvation. In another Shiite tradition, the Prophet declares that walayah to himself and the people of his house is a guarantee against entering the fire. Ja'far al-Sadiq considers intercession to be "one of the four unique doctrinal beliefs required of the Shiites."
According to Muhammad Baqir Majlisi the Shiite imams are "the mediators between God and mankind. Except by their intercession it is impossible for men to avoid the punishment of God". Ibn Babuwaihi has also recorded from Ja'far al-Sadiq who said "Our responsibility on behalf of mankind is great indeed, for if we call upon them to accept us they will not do so, and if we let them go their way they will not find other guides."
It is also narrated from both Shiite and Sunnis from the prophet who said, "Whoever dies and does not know the Imam of his own time, dies in the state of ignorance in which men died before the appointment of the Prophet of God," this is because, Shiite says, it is impossible to know God except via acknowledging the Imams. Otherwise men might "think of God as one who would create mankind and then leave them helpless, not appointing any Imam for them," so that they would not think of God as kind.
Believers (Shiite view): Shiite traditions admit the possibility that Shiite believers themselves, like the Prophet and the Imams, may act as intercessors for others; so that the Shiite believers are considered as the ones who both receive and grant intercession. some other traditions asserts that Shiites would be able to intercede for the members of their families (ahl baytihim) or those who aided them in their life.
This kind of intercession is considered parallel with the Sufi perspective which also extended the spiritual intercession to the realized saints. However, in contrary to Shiites, Sufis do not extend the intercessory function to all believers.