Parliaments adopts new law after presidential U-turn following mass protests and backlash from western allies