Chronic inflammation plays a pivotal role in the pathogenesis of hepatocellular carcinoma (HCC) and intrahepatic cholangiocarcinoma (ICC), the two most common types of liver cancer. A number of prior experimental studies have suggested that non-steroidal anti-inflammatory drugs (NSAIDs), including aspirin and ibuprofen, may potentially protect against liver cancer. However, no observational study has examined the association between aspirin duration and dose or other over-the-counter non-aspirin NSAIDs, such as ibuprofen, and liver cancer incidence. Furthermore, the association between NSAID use and risk of ICC is unclear. As part of the Liver Cancer Pooling Project, we harmonized data on 1,084,133 individuals (HCC=679, ICC=225) from ten US-based prospective cohort studies. Cox proportional hazards regression models were used to evaluate multivariable-adjusted hazard ratios (HRs) and 95% confidence intervals (CIs). Current aspirin use, versus nonuse, was inversely associated with HCC (HR=0.68, 95% CI=0.57-0.81), which persisted when restricted to individuals not using non-aspirin NSAIDs and in a 5 and 10-year lag analysis. The association between aspirin use and HCC risk was stronger for users who reported daily use, longer duration use, and lower dosage. Ibuprofen use was not associated with HCC risk. Aspirin use was associated with a reduced ICC risk in men (HR=0.64, 95% CI=0.42-0.98) but not women (HR=1.34, 95% CI=0.89-2.01, pinteraction=0.01). The observed inverse association between aspirin use and liver cancer in our study, together with previous data, suggest the merit of future intervention studies of aspirin and other agents that affect chronic inflammatory pathways for HCC and possibly ICC.