The fused heterocyclic compound represented by formula (1), or an N-oxide thereof, has excellent effectiveness in pest control. (In the formula, G1 represents a nitrogen atom, etc. G2 represents a nitrogen atom, etc. A1 represents a nitrogen atom, etc. A2 represents a nitrogen atom, etc. A3 represents a nitrogen atom, etc. A4 represents a nitrogen atom, etc. A5 represents a nitrogen atom, etc. R1 represents a C1-C6 chain hydrocarbon group, etc., optionally having one or more atoms or groups selected from group X R2, R3 and R4 are the same or different, and represent a C1-C6 chain hydrocarbon group, etc., optionally having one or more atoms or groups selected from group X R5 and R6 are the same or different, and represent a C1-C6 chain hydrocarbon group, etc., optionally having one or more atoms or groups selected from group X and n represents 0, 1, 2).