A gas sensor including: a cylindrical metal shell; a detection element
having a detection portion provided on a front end side thereof, the
detection element being fixed inside the metal shell while the detection
portion of the detection element protrudes from a front end side of the
metal shell; and an element protection cap having ventholes, the element
protection cap being fixed to the metal shell so that the detection
portion of the detection element is covered with the element protection
cap. A crimping cylindrical portion is provided which extends to a front
end side of the metal shell. A protrusion portion of the element
protection cap which abuts a metal ring packing is provided with concave
and convex portions outward along an outer circumferential direction. As
such, the metal ring packing is deformed so as to be interlocked with the
concave and convex portions when the crimping cylindrical portion is
compressively deformed.