Sufficient safety of welded structures against fatigue damage is achieved through the use of several safety procedures, design of the structure, quality control of the welding procedure during fabrication, and inspection for fatigue cracks with subsequent repair of detected cracks. Each safety procedure has a certain cost, and it is important to minimize the total expected cost over the lifetime of the structure. The present paper presents a probability-based optimization procedure defining optimal initial design, quality of welding procedure at fabrication, time of inspections, quality of inspections, and length of weld to be inspected at each inspection for a continuous weld. The cost considered in the optimization is cost-related to initial design, cost of fabrication, cost of inspection, expected repair cost, and expected failure cost. The probabilistic optimization problem is formulated for a homogeneous continuously welded structure containing hazardous material for which no leakage is permissible. The weld seam considered has multiple potential crack initiation sites from weld defects, where all the crack initiation sites are exposed to the same stochastic loading condition. Two models are applied to define the distribution of weld defects over the weld seam: a model where the locations of the crack initiation sites are known, and a model where the locations and number of crack initiation sites are unknown and described through a homogeneous Poisson distribution process. Uncertainties in the long-term stochastic load process, the fatigue strength, and the crack size of the different initial defects are considered in the procedure.