The Green–Schwarz mechanism (sometimes called the Green–Schwarz anomaly cancellation mechanism) is the main discovery that started the first superstring revolution in superstring theory.
In 1984, Michael Green and John H. Schwarz realized that the anomaly in type I string theory with the gauge group SO(32) cancels because of an extra "classical" contribution from a 2-form field. They realized that one of the necessary conditions for a superstring theory to make sense is that the dimension of the gauge group of type I string theory must be 496 and then demonstrated this to be so.
In the original calculation, gauge anomalies, mixed anomalies, and gravitational anomalies were expected to arise from a hexagon Feynman diagram. For the special choice of the gauge group SO(32) or E8 x E8, however, the anomaly factorizes and may be cancelled by a tree diagram. In string theory, this indeed occurs. The tree diagram describes the exchange of a virtual quantum of the B-field. It is somewhat counterintuitive to see that a tree diagram cancels a one-loop diagram, but in reality, both of these diagrams arise as one-loop diagrams in superstring theory in which the anomaly cancellation is more transparent.