A British soldier facing court martial in Britain has pleaded guilty to committing the war crime of treating detainees inhumanely while serving in Iraq .