There is scarce literature from the region pertinent to university students' HIV-related knowledge, perception, attitudes, and behavior toward people living with HIV. Moreover, university students in Oman are remarkably uninformed about HIV, resulting in misconceptions and stigmatization among students. This research aimed to examine HIV-related knowledge and attitudes of undergraduate medical and non-medical university students toward people living with HIV in Oman. This was a qualitative cross-sectional study using convenience sampling to recruit participants from nine colleges at Sultan Qaboos University, Muscat, Oman. An online questionnaire composed of 17 Likert scale statements examining students' knowledge and nine Likert scale statements exploring students' attitudes was used. A knowledge score ≥ the mean was considered good knowledge, whereas a stigma score > the mean was regarded as stigmatization. A sample size of 376 students was computed using a Raosoft calculator (Raosoft, Inc., Seattle, Washington, United States) with a confidence level of 95% and a margin of error of 5%. Cronbach's alpha for the 26-item questionnaire was α = 0.716. Responses were collected and analyzed using IBM SPSS Statistics for Windows, Version 26, (Released 2019; IBM Corp., Armonk, New York, United States). The questionnaire and the study protocol were approved by the institution's medical research and ethics committee. A total of 678 undergraduate university students responded to the questionnaire including 450 (66.4%) and 228 (33.6%) female and male students, respectively. Medical students represented 20.8% of the responders. The mean knowledge score was 12.3 ± 1 signifying good knowledge in 72% of the students and the mean stigma score was 6.03 ± 3.51 indicating that 43.4% of the responders had a negative and stigmatizing attitude. Medical students had the highest mean knowledge score (14.2 ± 1.8) denoting good knowledge in 83.5% of the students. Additionally, medical students had the lowest mean stigma score (4.64 ± 3.32) implying that 29% of the surveyed medical students had negative attitudes toward people living with HIV. No significant association was found between students' academic performance or students' sex with mean knowledge scores. Contrarily, male sex was found to be significantly associated with lower mean stigma scores. No significant relationship between students' knowledge scores and stigma scores was observed. The findings of this study denote a substantial gap in HIV-related knowledge among university students, leading to undesirable attitudes toward people living with HIV. These findings call for an urgent need to escalate HIV awareness and educational programs tailored to university students in Oman.