Background: Pre-exposure prophylaxis (PrEP) and post-exposure prophylaxis (PEP) have been increasingly available in Europe. Due to the high burden of HIV in key populations, these could benefit from their use. In 2016, in Portugal, an open, non-interval, prospective cohort study was established in a network of 26 community-based voluntary HIV/STI counseling and testing centers. Data collected included questions on PEP and PrEP knowledge and use. We aimed to estimate the proportion of PEP and PrEP knowledge and its use among key populations, visiting the centers between 2016 and 2019.Method and results: Individuals who self-identify as being among at least one key population for HIV, men who have sex with men (MSM), people who inject drugs (PWID), sex workers (SW), migrants, and male-to-female transgender individuals (MTF), responded to questions on PEP and PrEP knowledge and use while waiting for their test results between 2016 and 2019 (n = 12,893 for PEP; n = 10,973 for PrEP). Reported knowledge was low in all key populations for both tools: 15.7% of respondents reported knowing about PEP and 10.9% about PrEP over the course of 4 years. PEP was used by 1.8% and PrEP by 0.4% of the respondents, MSM being 88.9% of PrEP users, and 52.8% of PEP users. Multivariate logistic regression showed multiple factors associated with knowing the tools, including age, education, country of birth, gender, year of test, having a reactive HIV test in the same visit, reporting an STI or condomless sex in the last 12 months, and identifying with being MSM or SW.Conclusions: Knowledge and use of PEP and PrEP remain low among key populations in Portugal. The need remains to increase knowledge and use among those at risk for HIV infection.