The flux-flow oscillator (FFO) based on a long Josephson junction has been implemented as a broadband tunable terahertz (THz) source to open space. For this purpose, the transmitting slot antenna has been coupled to the oscillator. Additionally, an elliptical lens with a diameter of 10 mm has been matched to the antenna, forming a narrow output beam of the THz emission. Two designs for the antenna, integrated with the oscillator and developed for operation at different frequency ranges of 0.32-0.55 THz and 0.4-0.7 THz, have been investigated. The FFO has been phase locked to an external reference oscillator by utilizing a harmonic mixer. Its linewidth in the phaselocking regime is determined by the phase noise of the reference oscillator and the number of harmonics used and has been measured to be less than 0.1 MHz. A free-running FFO linewidth from about 2 MHz to several MHz, depending on the operating point, has been obtained. Output emission to open space has been measured by a superconducting integrated spectrometer located in a separate cryostat. The FFO operation as an external source with the achieved emission power and spectral characteristics has demonstrated its applicability for different tasks and purposes where tunable THz sources are required.