In this work, a GC x GC - nitrogen - phosphorus detection (NPD) methodology was developed to separate and quantitate nitrogen-containing compounds in Brazilian heavy gas oil. First, the NPD performance was improved in order to achieve best GC x GC performance. The geometry of this detector was also evaluated. The use of an extended jet improved significantly the peak shape. The GC x GC separation was studied using both first and second dimension columns with different internal diameters. The use of a thicker film in both dimensions provided better performance. LODs of 0.16-8.49 pg of individual compounds were achieved. Two different extraction techniques of the neutral and basic nitrogen-containing compounds were also evaluated. The method using ion-exchange resins to separate neutral and basic nitrogen-containing compounds was more efficient than the method using modified silica. As an example, the amounts ( mu g/g) of each class reported were: indole (2.77), alkyl carbazoles ranging from C(0) to C(6+)(1.467), alkyl benzocarbazoles from C(0) to C(4+) (793), alkyl quinolines (31.2) and alkyl benzoquinolines (21.6) were quantitated.