Fourier synthesis of ultrafast optical-pulse trains was demonstrated based on optical phase locking of three independent continuous-wave semiconductor lasers. Pulse repetition frequencies as high as 1.81 THz were limited by the gain bandwidth of an erbium-doped fiber amplifier. The waveforms of the pulse trains were maintained over a long period by use of an auxiliary optical phase-locked loop. The repetition frequency could be tuned continuously over a range of 100 MHz.