A left-leaning coalition of four parties won by the narrowest possible majority.