Predicting recent intercourse is crucial in forensic casework on sexual assaults. In this work, we assessed whether sexual intercourse can be predicted based on the vaginal microbiome and compared it to the gold standard method of semen detection. Using a prediction model based on microbiome of 3,043 women, intercourse was predicted with 71% accuracy in a balanced cross-validation machine learning setting. Next, this prediction model was validated in a longitudinal intervention study and tested on forensic sexual assault cases. The developed predictor could accurately establish intercourse in 82% cases. Yet, underwear was found to hold an even greater evidential value and replace the more invasive vaginal sampling for semen detection in some cases, with an accuracy of 95%. This was confirmed through a retrospective analysis of 207 forensic sexual assault cases. Taken together, this study revealed the potential of both microbiome profiling on vaginal swabs and semen detection on underwear for forensic casework.