His position is precarious, and a defeat would have badly damaged his government.