The exchange was secured after mediators helped avert a collapse of the ceasefire; Germany’s chancellor has blasted J.D.