There is provided an optical transmitting and receiving unit that can make an optical connecting portion waterproof even when an endoscope or the like is, for example, damaged by use. An optical transmitting unit 100 includes: an optical transmitting and receiving module 20; an optical connector 30; and a tubular waterproof cap 10 that has a bottom, with one end open and the other end closed, and caps the optical connector 30 to seal an optical connecting portion between the optical connector 30 and the optical transmitting and receiving module 20 in a watertight manner. A metal case 23 has a plurality of step portions 23a to 23g with different outside diameters, and the step portion 23a closest to the optical connecting portion contacts an inner surface of the waterproof cap 10 along an entire circumference thereof.