Moviepooper (Short Ending):
The Avengers defeat the Chitauri army, Iron-Man almost sacrifices himself to dispose of the super nuclear bomb launched at NYC, diverting it to hit the alien fleet instead. The Hulk takes down Loki, the army's commander, and he is sent with Thor back to their home realm of Asgard to stand trial for his crimes. Nick Fury defies the council's orders and allows the Avengers to disassemble go their separate ways, but notes that they will assemble again when the world is in need of them. Two secret scenes after the credits (one of which sets up a potential sequel).
Movie Spoiler (Full Summary):
The Avengers is the culmination of developments set up in the following films - Iron Man (introduces Nick Fury (in a secret scene in the end), Pepper Potts, and Agent Coulson); Iron Man 2 (introduction to SHIELD and the Black Widow); The Incredible Hulk (no direct ties, but chronicles Banner's development of his Hulk powers with Edward Norton in the title role); Thor (cameo of Hawkeye and introduces main Avengers villain Loki and supporting character Selvig); and Captain America (introduces the tesseract, also known as the cosmic cube).
We open on a member of the alien race called the Chitauri discussing the tesseract (an object of pure energy) that was lost on Earth during World War II, but recently recovered. He notes that the humans don't understand its power, and that it can open a gateway between their world and ours. The alien is discussing this with a hidden entity, the mastermind of the villainous plot. They assign their new ally Loki (Tom Hiddleston - Thor's adopted brother who had been sucked into an abyss at the end of Thor) to obtain the tesseract and use its power to open a gateway between Chitauri space and Earth. In return, the Chitauri army will help Loki take over the world.
Cut to Nick Fury (Samuel L. Jackson), the head of the worldwide defense operation SHIELD is experimenting on the Tesseract as it possesses a potentially unlimited source of clean energy. The tesseract, seemingly of its own accord, then opens a small portal allowing Loki through. Loki easily overwhelms the guards, and then takes control of the minds of SHIELD super hero/agent Clint Barton/Hawkeye (Jeremy Renner) and SHIELD astrophysicist Selvig (Stellan Skarsgard). He successfully steals the tesseract, despite the attempts of Nick Fury and agent Maria Hill (Cobie Smulders) to stop them.
The council in charge of SHIELD want him to initiate Phase 2, but Fury instead decides to activate the Avengers protocol. The team is eventually collected, consisting of SHIELD spy Natasha Romanova/Black Widow (Scarlett Johansson) who is on an undercover mission and was Hawkeye's partner, industrialist/inventor Tony Stark/Iron-Man (Robert Downey Jr.) who has just opened Stark Tower that utilizes a newly invented source of clean energy, super-soldier Steve Rodgers/Captain America (Chris Evans) who has had a tough time adjusting to the modern era after being freed from his ice tomb where he had been in suspended animation since World War II; and scientist Bruce Banner/Hulk (Mark Ruffalo) who has been working as a doctor in India. Banner is brought on only to serve as a gamma radiation consultant (the tesseract gives off gamma radiation) as the Hulk is too volatile and dangerous to be on the team. The team encounters and captures Loki in Germany, not knowing that Hawkeye has managed to obtain another vital piece to enact the Tesseract portal while Loki was causing a distraction.
Asgardian god and Loki's brother Thor (Chris Hemsworth) is transported back to Earth by their father Odin (Loki is Odin's adopted son) to take both Loki and the tesseract back to Asgard. A fight ensues between Captain America, Iron-Man and Thor over Loki's custody, but they eventually agree to keep him incarcerated with SHIELD until the tesseract is recovered.Thor allies himself with the team (it is also revealed that Thor's human love interest Jane Foster was moved well outside of the US by SHIELD once he joined the team to ensure her safety). It is clear that the team members are unable to work together and the team is highly dysfunctional. Iron-Man, Captain America, and Banner eventually discover that SHIELD had used actually been using the tesseract to create a more powerful "nuclear" bomb to defend the Earth from extraterrestrial forces such as the Asgardians. Black Widow interrogates Loki and tricks him into revealing that he is manipulating Banner to release the Hulk (hoping the Hulk will either kill the Avengers or cause them to disband). Before they can evacuate Banner, Hawkeye orchestrates a sneak attack on the Hellicarrier - SHIELD's flying fortress, damaging one of the helicarrier's engines. During the struggle, the Hulk is unleashed and almost kills Black Widow before being fought and barely defeated by Thor; Loki is released and defeats and humiliates Thor; Loki kills Agent Coulson as Coulson attempts to save Thor and defeat Loki; Black Widow fights Hawkeye and knocks him out, thus freeing him of Loki's mind control; and Iron-Man and Captain America manage to repair the hellicarrier's engine before it crashes.
Having regained his senses, Hawkeye agrees to become the final member of the Avengers to take revenge on Loki for manipulating him into committing crimes. There is obviously a long, possibly romantic history between he and the Black Widow, that is not fully explored in this film. The Avengers finally unite around Agent Coulson's heroic death and discover that Loki is intending to use Stark Towers to power the tesseract portal. The Avengers arrive too late to stop Loki from opening the portal, though Iron-Man vows to avenge the Earth if it can't be saved.
A large fight ensues between the aliens, led by Loki, and the Avengers, led by Captain America. Banner manages to rejoin them and reveals that, when focused, he has general control of The Hulk. Banner unleashes Hulk on the alien army. Thor fights with and attempts to have Loki stand down to no avail. Meanwhile, the council orders Nick Fury to initiate Phase 2 - which is the plan to use the super atomic bomb to destroy the portal, but also New York in the process. Although both Fury and Hill refuse to obey these orders, agents working directly for the council manage to shoot the weapon at New York City where the battle is taking place.
Eventually the Hulk confronts and defeats Loki. Iron-Man realizes that the bomb has been launched at NYC, and he intercepts it, flying it through the portal to Chitauri space before falling unconscious there. The bomb strikes the Chitauri space center, killing all of the Chitauri soldiers on Earth (who were apparently linked in some critical but unexplained way to the command center). Selvig, who has recovered from Loki's control since Loki's defeat, explains that he built a failsafe in the tesseract to close the portal despite his being under mind control. Black Widow activates the failsafe and closes the portal between Earth and the Chitauri planet. Iron-Man's seemingly lifeless body hurtles back through the portal to Earth just before the portal is closed. The heroes are about to mourn Iron-Man's passing when he miraculously recovers. Iron-Man says that now that he is alive and the world is saved, they can enjoy and fully experience things in life they have never done, such as eating schwarma (a middle eastern food). The team reminds him that they still have to take Loki into custody, which is easy since he is still severely injured from his fight with the Hulk and his army is defeated.
We cut to after the incident. While some view the Avengers as a threat or a hoax (including Stan Lee, in a cameo appearance), the majority welcome the team as heroes. Nonetheless, Nick Fury has allowed the team to disband and pursue their own private lives, much to the displeasure of the council who now wants the Avengers fully under their control. Loki and the tesseract are handed over to Thor, who returns with them to Asgard. The others go in their own as yet unrevealed directions. We also watch as Tony Stark makes plans for what will likely be Avengers tower (rather than Stark tower), along with Pepper Pots who now wears an engagement ring (ostensibly given to her by Stark). Nick Fury assures Maria Hill and the council that when they are needed, the Avengers will assemble once again.
Secret after-credit scene 1:
A Chitauri alien is reporting the invasion's failure to the mastermind of the invasion. The alien concludes that any further attacks on Earth would only invite widespread death. The mastermind turns around and, with a huge smile on his face, it is revealed that the mastermind is Marvel super-villain Thanos (in the comics, Thanos is a powerful alient entity who seeks to destroy the universe to impress his love Death (who in the comics is a female entity) and uses the infinity gauntlet (which was seen in Odin's trophy-room in Thor) to try and achieve such goals). It is implied that Thanos will be taking on the Avengers in a potential sequel.
Secret after-credit scene 2:
We see the Avengers eating schwarma in a half-destroyed NYC eatery. All are still in their battle gear, and all seem thoroughly unimpressed with the food, except perhaps, for the Black Widow who takes a second bite before the scene fades to black.