Soliton gases represent large random soliton ensembles in physical systems that exhibit integrable dynamics at the leading order. Despite significant theoretical developments and observational evidence of ubiquity of soliton gases in fluids and optical media, their controlled experimental realization has been missing. We report a controlled synthesis of a dense soliton gas in deep-water surface gravity waves using the tools of nonlinear spectral theory [inverse scattering transform (IST)] for the one-dimensional focusing nonlinear Schrödinger equation. The soliton gas is experimentally generated in a one-dimensional water tank where we demonstrate that we can control and measure the density of states, i.e., the probability density function parametrizing the soliton gas in the IST spectral phase space. Nonlinear spectral analysis of the generated hydrodynamic soliton gas reveals that the density of states slowly changes under the influence of perturbative higher-order effects that break the integrability of the wave dynamics.