Sahih Muslim Book 1, Hadith Number 205.

Chapter : Suicide is the gravest sin.

It is narrated on the authority of Abu Huraira: We participated in the Battle of Hunain along with the Messenger of Allah (may peace be upon him). He (the Holy Prophet) said about a man who claimed to be a Muslim that he was one of the denizens of the Fire (of Hell). When we were in the thick of the battle that man fought desperately and was wounded. It was said: Messenger of Allah, the person whom you at first called as the denizen of Fire fought desperately and died. Upon this the Apostle of Allah (may peace be upon him) remarked: He was doomed to the Fire (of Hell). Some men were on the verge of doubt (about his fate) when it was said that he was not dead but fatally wounded. When it was night he could not stand the (pain of his) wound and killed himself. The Apostle (may peace be upon him) was informed of that. He (the Holy Prophet) observed: Allah is Great, I bear testimony to the fact that I am the servant of Allah and His messenger. He then commanded Bilal to announce to the people that none but a Muslim would enter Paradise. Verily Allah helps this faith even by a sinful person.