Twenty-five years ago, John Schwarz and Michael Green were spending their summer in Aspen, Colorado and they were working hard. The physicists were realizing that superstring theory was so intellectually sexy that it simply couldn't have suffered from anomalies.
Type I string theory whose low-energy limit is the d=10 type I supergravity coupled to d=10 supersymmetric Yang-Mills theory was widely believed to have anomalies. It is a chiral, left-right asymmetric theory with a lot of charged chiral fermions and similar stuff. Vague arguments indicate that the anomalies have to be there and they have no good chance to cancel.
Green and Schwarz had to calculate them in detail. And of course, they were right. All the anomalies canceled. The Green-Schwarz mechanism, involving an unusual transformation rule of some objects under gauge transformations and additional interactions was found to be there. It provided them with new, previously overlooked terms that cleaned the mess.
A new tree-level diagram, with one cubic and one quintic vertex, and with six external legs, was contributing to the one-loop diagram with a chiral fermion in the loop and with the same external legs. It is helpful to look at the equations in some detail:
Each of the chiral fermions - the gravitino 56, the dilatino 8', and the gaugino 8 give complicated contributions that are found on other pages of Polchinski's and other books. However, each of these three objects contributes something to the different types of twelve-forms that measure the anomalies: F^6, F^2.F^4, (F^2)^3, F^2.R^4, F^2.(R^2)^2, R^6.
You have about six independent terms (twelve-forms) to cancel and only three "random" contributions. You may choose the gauge group but for type I theory, only SO(n) or USp(2n) are a priori possible, giving you one and only degree of freedom that can actually be adjusted (the rank). And the coefficients are as complicated as (n-496)/725,760. These six independent pieces of crap clearly can't simultaneously cancel (even if you adjust one discrete integer parameter), can they?
Well, they do: for the 496-dimensional gauge groups SO(32) and E8 x E8 (the importance of the latter group was understood by the 1985 heterotic string and the 1995 Hořava-Witten M-theory with domain walls). Green and Schwarz found one of the first great miracles of string theory. The predictions of many people that these anomalies couldn't have possibly canceled was so spectacularly falsified that most theorists had to move to string theory, the only framework that turned out to be able to produce answers that people "didn't know from the scratch", anyway.
One of the last sub-calculations they had to perform was the cancellation of the gravitational anomalies, R^6. They needed to compute the dimension of SO(32). How much was 31 x 16? One of them got a wrong result, 486, for the first time. However, the second time, he calculated correctly. String theory passed the elementary maths exam and a thunderstorm detonated in Aspen. "We must be getting pretty close to the final answer because God is trying to prevent us from finding it," Green said. ;-)
Schwarz announced their discovery during a theater play in Aspen where he was starring as a mad man who babbled that they had just found a theory of everything. In this comedy show, some other actors dragged him into the mental asylum because they didn't realize he was actually right. :-)
Today, the cancellation of anomalies (and divergences, as Green and Schwarz often phrased it) can be understood more easily from the worldsheet perspective. Dozens of similar crucial "miracles" were found in string theory during those 25 years. People got used to them so that no good theoretical physicist as of 2009 has any serious doubts that superstring theory is a robust, fully consistent structure with all the required at least semi-realistic physics content needed for a theory of all particles and forces, and it is the only consistent quantum theory including gravity that we know (and more likely than not, that we will ever know).
The Green and Schwarz pioneering research was necessary for all the subsequent breakthroughs. Without their work or a similar work, we would have no AdS/CFT correspondence, M-theory, mirror symmetry, Matrix theory, F-theory, and lots of other things - or they would emerge much later. Without Green and Schwarz's lonely battles with the captivating mystery of string theory that waited to be discovered, high-energy theoretical physics would have become a linear superposition of unmotivated technical guesswork in the darkness and crackpottery already back in the 1980s.