Objective: To describe behaviors and knowledge related to sexual and reproductive health of Spanish university students and their association with the subject area studied (biomedical or not). Methods: A descriptive cross-sectional observational study conducted with 2074 students aged 18-24 years from the University Complutense of Madrid in the Faculties of Medicine and Law. Simple random stratified sampling without replacement was performed. A self-administered, anonymous and voluntary questionnaire was distributed. It was based on the Youth Risk Health Behavior Survey and assessed behavior and knowledge in three areas: sex, contraceptive methods (CM) and sexually transmitted infections (STIs). Results: In total, 83.5% of respondents had had sexual intercourse, from a mean age of 16.8 years and with a mean of 3.4 sexual partners. Compared with the law students (LS), fewer medical students (MS) were sexually active, they had a later age of sexual initiation and they had had fewer sexual partners (p < 0.001). High regular use of contraceptive methods was observed (92.8%), with no significant differences between groups, although LS had had more unprotected sex and had more often used emergency contraception than had MS (p < 0.001). In total, 81.5% of respondents knew about the vaccine against human papillomavirus, 60.8% its relationship with cancer and 43.2% had been vaccinated, the rates being significantly higher in MS (p < 0.001). Conclusions: The behavior and knowledge of medical students in relation to sexual and reproductive health differed from those of law students. (C) 2016 Elsevier B.V. All rights reserved.