We present the Survey for High-z Absorption Red and Dead Sources (SHARDS), an ESO/GTC Large Program carried out using the OSIRIS instrument on the 10.4 m Gran Telescopio Canarias (GTC). SHARDS is an ultra-deep optical spectro-photometric survey of the GOODS-N field covering 130 arcmin2 at wavelengths between 500 and 950 nm with 24 contiguous medium-band filters (providing a spectral resolution R ∼ 50). The data reach an AB magnitude of 26.5 (at least at a 3σ level) with sub-arcsec seeing in all bands. SHARDS' main goal is to obtain accurate physical properties of intermediate- and high-z galaxies using well-sampled optical spectral energy distributions (SEDs) with sufficient spectral resolution to measure absorption and emission features, whose analysis will provide reliable stellar population and active galactic nucleus (AGN) parameters. Among the different populations of high-z galaxies, SHARDS' principal targets are massive quiescent galaxies at z > 1, whose existence is one of the major challenges facing current hierarchical models of galaxy formation. In this paper, we outline the observational strategy and include a detailed discussion of the special reduction and calibration procedures which should be applied to the GTC/OSIRIS data. An assessment of the SHARDS data quality is also performed. We present science demonstration results on the detection and study of emission-line galaxies (star-forming objects and AGNs) at z = 0-5. We also analyze the SEDs for a sample of 27 quiescent massive galaxies with spectroscopic redshifts in the range 1.0 < z ≲ 1.4. We discuss the improvements introduced by the SHARDS data set in the analysis of their star formation history and stellar properties. We discuss the systematics arising from the use of different stellar population libraries, typical in this kind of study. Averaging the results from the different libraries, we find that the UV-to-MIR SEDs of the massive quiescent galaxies at z = 1.0-1.4 are well described by an exponentially decaying star formation history with scale τ = 100-200 Myr, age around 1.5-2.0 Gyr, solar or slightly sub-solar metallicity, and moderate extinction, A(V) ∼ 0.5 mag. We also find that galaxies with masses above M* are typically older than lighter galaxies, as expected in a downsizing scenario of galaxy formation. This trend is, however, model dependent, i.e., it is significantly more evident in the results obtained with some stellar population synthesis libraries, and almost absent in others.