2-Pyrazinyl (2) and 3-pyridazinylketone arylhydrazones (6) and their benzologues undergo a ring closure reaction to yield pyrazolo[3,4- b]pyrazines (4) and pyrazolo[4,3- c]pyridazines (7), respectively, in acceptable to good yields. The reaction was found to be accelerated by using acidic or basic conditions. Quantum chemical calculations suggest the key step of the mechanism to be a direct cyclization; analysis of aromaticity based on computed magnetic properties revealed its medium-dependent pericyclic or pseudopericyclic character. The cyclization reaction has also been extended for the synthesis of related ring systems ( 9, 12, 14).