BackgroundThe recently-appointed Hokage, Namikaze Minato, was married to Uzumaki Kushina, the jinchuriki of Kurama. When Kushina became pregnant and the birth of their son drew near. Special precautions had to be taken due to the fact that the seal keeping Kurama within her would weaken during childbirth, thus carrying the risk it might escape. News of Kushina's pregnancy was kept a secret from the general population and the delivery itself would take place in a remote cave away from the village. Minato's predecessor, Sarutobi Hiruzen, organized security: the site would be protected by a barrier, several Anbu would guard the area. While another Anbu (Taji) and Hiruzen's wife (Sarutobi Biwako) would be the midwives. Minato on the other hand would monitor the seal, keeping it stable during the delivery and restoring it to its original strength as soon as their son was born.
Despite all the secrecy, news of Kushina's pregnancy was discovered by Uchiha Obito, who overheard it from his ex team-mate Hatake Kakashi, while he spoke to Nohara Rin's grave at the Konoha Cemetery. Obito then located where the birth was taking place. He then infiltrated the barrier, then he killed the Anbu stationed outside. Obito finally arrived inside the cave mere moments after the child, Uzumaki Naruto, was born. Obito even killed the midwives and took Naruto hostage, threatening to kill him if Minato attempted to restore Kurama's seal. Minato was able to take Naruto back, only to discover explosive tags planted on him. Minato was forced to teleport away with the Flying Thunder God Technique to keep Naruto safe, leaving Kushina behind with Obito.Obito moved Kushina to a new location and placed her under restraint while he took steps to further weaken the seal. As the seal was about to break, he used his Sharingan to enter Kushina's subconscious and place Kurama under his control. Kurama was extracted, a process that Kushina survived due to her Uzumaki heritage. Obito attempted to have Kurama kill her, but Minato tracked them down in time to save her, and escape to a safe-house where he left Naruto. Unconcerned by them, Obito led Kurama back to the village. Kushina was left in the safe house to look after Naruto, while Minato left to go defend the village from Kurama.
Even before Kurama arrived in the village, some sensed its approach: the young Uchiha Itachi felt something ominous and his infant brother, Uchiha Sasuke, began to cry. Kakashi detected a change in the air as he spoke with Maito Gai, though he did not know the cause. Hiruzen sensed Kurama while he worked in his office, aghast by the implication. Obito snuck back in to the village and summoned Kurama by using it to launch an immediate attack. An Anbu reported Kurama's appearance to Hiruzen, who had already changed into his combat uniform to lead the village's defense.
ClimaxMinato teleported to the Hokage Monument to lend his assistance. Kurama immediately noticed his presence and attacked with a Tailed Beast Ball, which he sent away with his Flying Thunder God: Guiding Thunder, a contribution noticed by the Ino–Shika–Cho as they headed into battle. Minato attempted to locate Hiruzen so that he could tell him what happened, but he was stopped by Obito. Obito started to teleport Minato away, but Minato used his own teleportation to escape. Obito followed. From Obito's actions, Minato speculated that Obito was in fact Uchiha Madara, who had decades earlier tried to use Kurama to destroy Konoha. Obito didn't deny Minato's claim, but he did allude to having some purpose behind the attack. Minato and Obito clashed, with Minato after some difficulty, finally managing to strike Obito with the Rasengan.
During his attack, Minato was able to brand Obito with the Flying Thunder God formula, allowing him to teleport to Obito's location whenever he wanted. He immediately did so to strike again, this time to place a Contract Seal on Obito that removed Kurama from his control. Injured and deprived of his best weapon, Obito fled, vowing that it was only a temporary setback. In Konoha meanwhile, many of the village's children had been taken away from the village and confined behind a barrier so that they would not be killed trying to protect the village. Others weren't so fortunate: Umino Iruka's parents, Kohari and Ikkaku, died protecting him from Kurama's attacks. In the anime, Itachi ran through the village with Sasuke in his arms, trying to find their own parents.
Once free from Obito's control, Kurama tried to retreat from the village. It was pursued by Konoha's forces, led by Hiruzen, prompting it to retaliate with another Tailed Beast Ball. Minato returned to the village in time to stop it by summoning Gamabunta above it, having Gamabunta to keep Kurama restrained while he gathered the chakra to teleport it away. Minato took the Kurama to the safe-house where he'd left Kushina and Naruto, since it was the furthest away from the village that he could get. Kushina retrained it and cut off access to the area with her Adamantine Sealing Chains while she and Minato decided what to do with it.Already dying from her earlier ordeal, Kushina offered to have Kurama sealed back in her once again so that it would die with her. Believing Kurama's power would be needed in the future to face Obito, Minato rejected this idea, deciding instead to seal Kurama into Naruto using the Eight Trigrams Seal. Because Kurama was too powerful to contain within the body of an infant, Minato used the Dead Demon Consuming Seal to cut its chakra in half. Minato seal the Yin half into himself by leaving only its yang chakra yet to seal inside Naruto. When it realized what they were planning, Kurama tried to kill Naruto, forcing Minato and Kushina to use their own bodies to shield him. While Kushina had some final words with Naruto, Minato gave the key to the seal he made to Gerotora and then sent him to Jiraiya.
Hiruzen followed Minato to their location, but could not break through Kushina's barrier. Minato didn't have the time necessary to tell Hiruzen what had happened. He chose instead to make a request of Konoha's villagers via Hiruzen: to regard Naruto as a hero for helping save the village, and not hate him for containing the monster that had killed so many. With that, Minato sealed Kurama into Naruto, adding his and Kushina's chakra to the seal so that they could watch him grow up and someday help him gain control of Kurama.
AfternathSince the resealing of Kurama happened far from Konoha, only Sarutobi Hiruzen and the two shinobi that accompanied him, bore witness to Minato and Kushina's sacrifice. Before she died, Kushina reveal her final wish to Hiruzen was for the young man to protect Naruto, in which the latter agree as Kushina finally died with a smile on her face. Hiruzen brought Naruto back to Konoha. With Minato and Kushina dead, Hiruzen decided it would be best if nobody knew of Naruto's relationship to Minato so that Minato's old enemies wouldn't come after him. To that end, he gave Naruto Kushina's family name.
Being Hokage once again, Hiruzen shared Minato's final request with the survivors. Only a few of the villagers would come to accept Minato's final wish that Naruto be seen as a hero, such as Hiruzen, Kakashi, Iruka, Tuechi, Ayame, Mikoto, and Itachi. But most villagers would not, since they were incapable of setting aside their grief and bitterness in the awake of the death and destruction of the attack. Hoping that future generations wouldn't hate Naruto in the same way that their parents did, Hiruzen forbade anyone from discussing Kurama. This largely failed, as those in Naruto's age group only copied their parents' hate, though they didn't understand why. Naruto, already an orphan, grew up lonely.Because Minato was never able to explain what had happened, Konoha's villagers were left to come up with their own explanations for Kurama's attack. Kurama had historically attacked human settlements, drawn to large concentrations of humanity's dark nature. Accordingly, many assumed it was just a natural occurrence that nobody was responsible for. Konoha's leadership however, believed an Uchiha was responsible. Both because of the Sharingan's famed ability to control Kurama and the Uchiha's absence while defending the village. (In the anime, the Uchiha avoided direct engagement with Kurama on the orders of Shimura Danzo.) The Uchiha, having helped create Konoha decades earlier, were offended by this mistrust, setting in motion the events that would lead to the Uchiha Clan Massacre.
Jiraiya, as Minato's former teacher, believed there was more to the events of that night. He, like Minato, suspected Uchiha Madara's involvement, despite how old Madara would have had to be at the time. He also felt that Minato's decision to seal Kurama into his own son was significant, assuming he intended for Naruto to someday gain control of Kurama's power for some purpose Jiraiya couldn't guess. As such, Jiraiya took on Naruto as a disciple once he was old enough, training him to take advantage of Kurama's chakra and using the key Minato sent to him to accelerate the process. Obito, the threat that Minato wanted Naruto to be prepared for, would ever-after deny any involvement in the attack, insisting it was the natural outcome of Konoha's years of benefiting off the misfortunes of others.
In the anime, it was revealed that the fox had left behind large residual traces of its chakra during the attack. Taking advantage of this for his own agenda, Kazuma collected and sealed Kurama's chakra within his own son, Sora, turning him into a pseudo-jinchuriki.
all information on the Kyuubi's Attack on Konoha is from http://naruto.wikia.com/wiki/Nine-Tails'_Attack_on_Konoha