The COVID-19 pandemic led to a shutdown of universities in Germany. In a longitudinal design, we compared mental health (depression, anxiety, somatic complaints) of university students in Germany before (June to August 2019) and in the course of the COVID-19 pandemic (June 2020) and determined the impact of pandemic-related stress and loneliness on students’ mental health in self-report online surveys. We investigated 443 participants (mean age 22.8 years), among them 77% female, and 10.4% medical students. A small increase of depression mean scores was observed (F(1,420) = 5.21; p = .023), anxiety and somatic complaints have not significantly changed. There was a medium increase in loneliness from pre-pandemic scores to the pandemic situation (F(1,423) = 30.56; p < .001). Analyzed with regression analyses, current loneliness and pre-pandemic distress represented the strongest associations with mental health during the pandemic. Additionally, health-related concerns during the pandemic were associated with symptoms of depression [b = 0.21; 95%CI(0.08; 0.34); t = 3.12; p = .002], anxiety [b = 0.07; 95%CI(0.01; 0.12); t = 2.50; p = .013], somatic complaints [b = 0.33; 95%CI(0.18; 0.47); t = 4.49; p < .001], and loneliness [b = 0.10; 95%CI(0.03; 0.17); t = 2.74; p = .006]. Social stress due to the pandemic situation was associated with loneliness [b = 0.38; 95%CI(0.32; 0.45); t = 11.75; p < .001]. The results imply that university students represent a risk group for psychosocial long-term ramifications of the pandemic.