This fused heterocyclic compound represented by formula (1) (in the formula, G1 represents a nitrogen atom or the like, G2 represents a nitrogen atom or the like, A1 represents a nitrogen atom or the like, A2 represents a nitrogen atom or the like, A3 represents —NR8— or the like, A4 represents a nitrogen atom or the like, A5 represents a nitrogen atom or the like, R1 represents a C1-C6 chain hydrocarbon group or the like optionally having one or more atoms or groups selected from a group X, R2 and R3 are the same or different and represent a C1-C6 chain hydrocarbon group or the like optionally having one or more atoms or groups selected from the group X, R8 represents a C1-C6 chain hydrocarbon group or the like optionally having one or more atoms or groups selected from a group W, and n represents 0, 1 or 2.), or an N-oxide thereof, is very effective for pest control.