Inclusion Criteria:  Concomitant presence of:  ARDS (moderate and severe) - Berlin definition  Within 1 week of a known clinical insult or new or worsening respiratory symptoms Bilateral opacities on CXR which are not fully explained by effusions, lobar/lung collapse or nodules Respiratory failure not fully explained by cardiac failure or fluid overload PaO2/FiO2<200 mmHg with PEEP<=5 cmH2O (invasive mechanical ventilation)  Inflammatory ARDS phenotype (28), defined by at least one of the following:  High plasma levels of inflammatory biomarkers Vasopressor dependence Lower serum bicarbonate or increased serum lactate Informed consent expressed by the patient or by legal representative or on the Ethical Committee indication. Age >=18 years  Exclusion Criteria:  Intubated and mechanically ventilated via an endotracheal or tracheostomy tube (>7 days) up to the time of randomization ARDS severe or moderate for more than 36 hours Untreated pulmonary embolism, pleural effusion or pneumothorax as the primary cause of ARF ARF fully explained by left ventricular failure or fluid overload Consent declined Severe chronic respiratory disease requiring domiciliary ventilation Clinical suspicion for significant restrictive lung disease Pregnant women or women of childbearing potential who are sexually active Known allergy to pirfenidone Concomitant use of fluvoxamine Known severe hepatic failure Known severe renal failure or necessity of dialysis not related to acute disease Little chance of survival (SAPS II score>75)