The Davis-Beirut reaction, which provides an efficient synthesis of 2H-indazoles and, subsequently, indazolones, is shown to proceed rapidly from o-nitrosobenzaldehyde and primary amines under both acid or base catalysis. Experimental and theoretical evidence in support of a reaction mechanism is provided in which o-nitrosobenzylidine imine is a pivotal intermediate in this N,N-bond forming heterocyclization reaction. The Davis-Beirut reaction is also shown to effectively synthesize a number of novel 3-amino-2H-indazole derivatives.