Facts
The appellant is a Senegalese national. In 2003 and 2006 he received residence permits on the basis of marriages to a Swiss national. A son came from the second marriage. After the separation in 2010, the Solothurn Migration Office ordered his removal from Switzerland in July 2015; the appeal proceedings against this remained unsuccessful. He let a further departure deadline expire at the end of December 2015, went into hiding, and reported to the Migration Office on 22 January 2016, whereupon he was placed in deportation detention. His fitness for detention was confirmed by expert opinion.
On 29 March 2016 the Administrative Court of the Canton of Solothurn dismissed an appeal against the deportation detention. A deportation attempt on 6 April 2016 failed due to the appellant's resistance. On 20 April 2016 the Migration Office ordered an extension of detention by six months. The appellant served a one-day substitute custodial sentence from 21 to 22 April 2016. On 22 April 2016 the detention court approved the extension of detention until 21 October 2016.
The appeal against the extension of detention filed by the appellant without a lawyer, together with his application for free legal representation, was dismissed by the Administrative Court in its judgment of 17 May 2016, on grounds including that he had been informed of the possibility of legal representation and that the appeal was futile. By submission of 6 June 2016, the appellant challenged these decisions before the Federal Supreme Court and complained, in substance, that the placement in and extension of deportation detention had taken place without legal representation and thus in violation of his fundamental rights. The Migration Office and the SEM requested dismissal. The legal representative subsequently appointed asked for access to the files and an extension of time, which became moot with the judgment.
The subject matter of the dispute was solely the free legal representation of the appellant in the detention proceedings.
Considerations
The Federal Supreme Court entered into the appeal in public law matters against the final cantonal decision on coercive measures in foreigners' law and the associated question of legal representation (Art. 82 lit. a, Art. 86 para. 1 lit. d FSCA). The submission of the appellant, who was not represented by a lawyer, was treated as an appeal insofar as it was directed against the judgment of 17 May 2016.
The statutory requirements for detention (Art. 76 para. 1 lit. b nos. 3 and 4 FNA) and the maximum detention period of 18 months (Art. 79 FNA) were undisputed. The complaint regarding the unreasonableness of enforcement due to illness was not entered into, as no violation of Art. 3 ECHR meeting the requirements of the qualified duty to raise complaints (Art. 106 para. 2 FSCA) was asserted, and no new evidence was admitted in the proceedings before the Federal Supreme Court (Art. 99 para. 1 FSCA).
The entitlement to free legal representation derives from Art. 29 para. 3 Cst. and presupposes that the legal remedy is not futile. In cases of deprivation of liberty, Art. 31 para. 2 sentence 2 Cst. additionally grants a right to the effective assertion of rights, which is why the requirement of the absence of futility must be relativised where the deprivation of liberty is of a certain intensity or duration. At the first detention review, legal representation is in principle not yet necessarily required; however, where detention exceeds three months, a serious restriction of liberty threatens to create factual or legal difficulties that can no longer be resolved without legal assistance. The decisive point is therefore the time at which this duration is reached (BGE 139 I 206, BGE 134 I 92, BGE 140 II 409).
At the time of the judicial approval of the extension of detention on 22 April 2016, the appellant had been in deportation…