It marked the close of an exhausting ordeal that began when the charity rescue boat was barred from entering ports in Italy and Malta, leaving the migrants stranded at sea.