Superconducting tunnel junctions (STJs) have been extensively investigated as photon detectors. They combine intrinsic energy resolution with good detection efficiency and high responsivity, thus providing energy-resolved photon-counting performance in a wide energy range, from the near iR (NiR) to the x rays. On this basis, STJs offer advantages with respect to alternative photon detection systems, such as an intrinsic energy resolution, higher speed, and when compared to wavelength dispersive systems, increased detection efficiency. We overview the STJ development in the Astrophysics Division of the European Space Agency (ESA), including STJ fabrication and operation, spectroscopic performance of single STJs, small arrays, and STJ-absorber structures in the UV-NIR and x-ray bands. As a first application we describe S-Cam, a cryogenic camera for ground-based optical astronomy exploiting a 6 x6 array of Ta STJs. This camera has undergone four campaigns at the 4.2-m William Herschel Telescope at La Palma (Spain), and future generations of the camera are under active development. For the soft x-ray band (50 to 3000 eV) a STJ-based instrument with an active area of 7 x 7 mm2 is proposed as part of the payload of the X-ray Evolving Universe Spectroscopy (XEUS) mission, which is currently under study at ESA. Future developments include devices based on lower Tc superconductors for improved energy resolution as well as larger format detector arrays combined with alternative readout schemes.