Loneliness is an emerging public health problem in developed countries. The objective was to establish the prevalence in a representative sample of a large city and its relationship with mental health indicators. Using stratified random sampling, a sample of 8,828 was obtained. The degree to which they had felt lonely during the last year and other questions and questionnaires related to their mental health were asked. A total of 10.2% reported feeling lonely during the last year. Those who felt lonely were four times more likely to develop more symptoms of poor mental health (63% vs. 16%), to receive a diagnosis of anxiety/depression, and to be prescribed psychotropic drugs. The structural model suggests that loneliness worsens mental health, leading to greater prescription of drugs, which increases feelings of loneliness. Loneliness tends to remain in anonymity and intimacy and is addressed mainly through the prescription of psychotropic drugs that aggravate the problem, plunging the subject into a vicious circle that is difficult to escape. The results make it necessary to offer more effective responses than a mere pharmacological approach.