A puncture needle device detachably attached to an ultrasonic endoscope via a pipe sleeve including a non-circular collar, including a cylindrical connecting body into which the pipe sleeve is inserted, the cylindrical connecting body including an insertion limit portion which contacts the pipe sleeve to prevent it from being further inserted, and a non-circular collar receiving hole engaged with the collar and irrotatable relative thereto when the pipe sleeve is inserted a sheath projecting from the cylindrical connecting body and inserted into an internal conduit of the ultrasonic endoscope a puncture needle inserted into the sheath and a lock member supported by the cylindrical connecting body and movable between an unlocked position allowing the pipe sleeve to insert and remove from the cylindrical connecting body, and a locked position wherein the lock member contacts the collar of the pipe sleeve to prevent it from removing from the cylindrical connecting body.