An electronic key comprising: upper and lower casings (10, 20) that are fitted to each other so as to seal the inside of the casings; an inner casing that is covered by the upper and lower casings and that has a battery mounted on a lower surface side of the inner casing, the battery being used to drive an electronic circuit configured to communicate with the outside of the electronic key; a waterproof rubber that covers an upper surface side of the inner casing; an upper casing projection that projects from an inner wall surface of the upper casing; and a waterproof-rubber outer-wall recess portion that is recessed from an outer wall surface of the waterproof rubber and that houses the upper casing projection; an inner casing projection that projects from an outer wall surface of the inner casing; and a waterproof-rubber inner-wall recess portion that is recessed from an inner wall surface of the waterproof rubber and that houses the inner casing projection, characterized in that a gap is formed between the upper casing projection and the waterproof-rubber outer-wall recess portion; a gap is formed between the inner casing projection and the waterproof rubber inner-wall recess portion; the inner casing projection is positioned at an upper position than the upper casing projection; the inner wall surface of the upper casing and the outer wall surface of the waterproof rubber are in contact with each other at an upper position than the upper casing projection; the outer wall surface of the inner casing and the inner wall surface of the waterproof rubber are in contact with each other at a lower position than the inner casing projection; the waterproof rubber holds the inner casing by contact between the waterproof-rubber inner-wall recess portion and the inner casing projection, and the upper casing holds the waterproof rubber by contact between the upper casing projection and the waterproof-rubber outer-wall recess portion. upper and lower casings (10, 20) that are fitted to each other so as to seal the inside of the casings; an inner casing that is covered by the upper and lower casings and that has a battery mounted on a lower surface side of the inner casing, the battery being used to drive an electronic circuit configured to communicate with the outside of the electronic key; a waterproof rubber that covers an upper surface side of the inner casing; an upper casing projection that projects from an inner wall surface of the upper casing; and a waterproof-rubber outer-wall recess portion that is recessed from an outer wall surface of the waterproof rubber and that houses the upper casing projection; an inner casing projection that projects from an outer wall surface of the inner casing; and a waterproof-rubber inner-wall recess portion that is recessed from an inner wall surface of the waterproof rubber and that houses the inner casing projection, characterized in that a gap is formed between the upper casing projection and the waterproof-rubber outer-wall recess portion; a gap is formed between the inner casing projection and the waterproof rubber inner-wall recess portion; the inner casing projection is positioned at an upper position than the upper casing projection; the inner wall surface of the upper casing and the outer wall surface of the waterproof rubber are in contact with each other at an upper position than the upper casing projection; the outer wall surface of the inner casing and the inner wall surface of the waterproof rubber are in contact with each other at a lower position than the inner casing projection; the waterproof rubber holds the inner casing by contact between the waterproof-rubber inner-wall recess portion and the inner casing projection, and the upper casing holds the waterproof rubber by contact between the upper casing projection and the waterproof-rubber outer-wall recess portion.