Directive (EU) 2016/1919 of the European Parliament and of the Council of 26 October 2016 on legal aid for suspects and accused persons in criminal proceedings and for requested persons in European arrest warrant proceedings

Article 4 - Legal aid in criminal proceedings
‘1. Member States shall ensure that suspects and accused persons who lack sufficient resources to pay for the assistance of a lawyer have the right to legal aid when the interests of justice so require.
2. Member States may apply a means test, a merits test, or both to determine whether legal aid is to be granted in accordance with paragraph 1.
3. Where a Member State applies a means test, it shall take into account all relevant and objective factors, such as the income, capital and family situation of the person concerned, as well as the costs of the assistance of a lawyer and the standard of living in that Member State, in order to determine whether, in accordance with the applicable criteria in that Member State, a suspect or an accused person lacks sufficient resources to pay for the assistance of a lawyer.
4. Where a Member State applies a merits test, it shall take into account the seriousness of the criminal offence, the complexity of the case and the severity of the sanction at stake, in order to determine whether the interests of justice require legal aid to be granted. In any event, the merits test shall be deemed to have been met in the following situations:
(a) where a suspect or an accused person is brought before a competent court or judge in order to decide on detention at any stage of the proceedings within the scope of this Directive; and (b) during detention.
5. Member States shall ensure that legal aid is granted without undue delay, and at the latest before questioning by the police, by another law enforcement authority or by a judicial authority, or before the investigative or evidence-gathering acts referred to in point (c) of Article 2(1) are carried out.
6. Legal aid shall be granted only for the purposes of the criminal proceedings in which the person concerned is suspected or accused of having committed a criminal offence.‘
Article 5 - Legal aid in European arrest warrant proceedings
‘1. The executing Member State shall ensure that requested persons have a right to legal aid upon arrest pursuant to a European arrest warrant until they are surrendered, or until the decision not to surrender them becomes final.
2. The issuing Member State shall ensure that requested persons who are the subject of European arrest warrant proceedings for the purpose of conducting a criminal prosecution and who exercise their right to appoint a lawyer in the issuing Member State to assist the lawyer in the executing Member State in accordance with Article 10(4) and (5) of Directive 2013/48/EU have the right to legal aid in the issuing Member State for the purpose of such proceedings in the executing Member State, in so far as legal aid is necessary to ensure effective access to justice.
3. The right to legal aid referred to in paragraphs 1 and 2 may be subject to a means test in accordance with Article 4(3), which shall apply mutatis mutandis.‘