The migrants had been camped out for three months near the offices of the U.N. refugee agency , demanding to be resettled in a third country .