Background People living with HIV-1 infection are at greater risk for cardiovascular disease than seronegative adults. Treatment of dyslipidaemia with statins has been challenging in people with HIV because of an increased potential for drug interactions due to competing cytochrome P450 metabolism between statins and commonly used antiretroviral agents. Neither pitavastatin nor pravastatin depend on cytochrome P450 for primary metabolism. We aimed to assess the safety and efficacy of pitavastatin versus pravastatin in adults with HIV and dyslipidaemia. Methods In the INTREPID (HIV-infected patieNts and TREatment with PItavastatin vs pravastatin for Dyslipidemia) randomised, double-blind, active-controlled, phase 4 trial (INTREPID, we recruited adults aged 18–70 years with controlled HIV (with CD4 counts >200 cells per μL and HIV-1 RNA <200 copies per mL) on antiretroviral therapy for at least 6 months and dyslipidaemia (LDL cholesterol 3·4–5·7 mmol/L and triglycerides ≤4·5 mmol/L) from 45 sites in the USA and Puerto Rico. Patients being treated with darunavir, or who had homozygous familial hypercholesterolaemia or any condition causing secondary dyslipidaemia, or a history of statin intolerance, diabetes, or coronary artery disease were not eligible. We randomly assigned patients (1:1) to pitavastatin 4 mg or pravastatin 40 mg with matching placebos once daily orally for 12 weeks, followed by a 40 week safety extension. Randomisation was stratified by viral hepatitis B or C coinfection and computer-generated. Investigators, patients, study staff, and those assessing outcomes were masked to treatment group. The primary endpoint was percentage change in fasting serum LDL cholesterol from baseline to week 12 and the primary efficacy analysis was done in the modified intention-to-treat population. The safety analysis included all patients who took at least one dose of study medication. This study is registered with ClinicalTrials.gov, number NCT01301066. Findings Between Feb 23, 2011, and March 29, 2013, we randomly assigned 252 patients to the pitavastatin (n=126) or pravastatin group (n=126). LDL cholesterol reduction was 31·1% with pitavastatin and 20·9% with pravastatin (least squares mean difference −9·8%, 95% CI −13·8 to −5·9; p<0·0001) at 12 weeks. At week 52, four patients (3%) in the pitavastatin group and six (5%) in the pravastatin group had virological failure, with no significant difference between treatments. Both treatments had neutral effects on glucose metabolism parameters. 85 patients treated with pitavastatin (68%) and 88 patients treated with pravastatin (70%) reported treatment-emergent adverse events, and these caused study discontinuation in six patients (5%) versus five patients (4%). No serious adverse event occurred in more than one participant and none were treatment-related according to investigator assessment. The most common treatment-emergent adverse events were diarrhoea in the pitavastatin group (n=12, 10%) and upper respiratory tract infection in the pravastatin group (n=14, 11%). 11 treatment-emergent serious adverse events were noted in seven patients (6%) in the pitavastatin group (atrial septal defect, chronic obstructive pulmonary disease, chest pain, diverticulitis, enterovesical fistula, gastroenteritis, viral gastroenteritis, herpes dermatitis, multiple fractures, respiratory failure, and transient ischaemic attack) and four events in three patients (2%) in the pravastatin group (cerebrovascular accident, arteriosclerosis coronary artery, myocardial infraction, and muscle haemorrhage). In the pravastatin treatment group, one additional patient discontinued due to an adverse event (prostate cancer that was diagnosed during the screening period, 42 days before first dose of study treatment, and therefore was not a treatment-emergent adverse event). Interpretation The INTREPID results support guideline recommendations for pitavastatin as a preferred drug in the treatment of dyslipidaemia in people with HIV. Funding Kowa Pharmaceuticals America and Eli Lilly and Company.