Ben Stokes's remarkable 135 not out saw England reach an unlikely victory target of 359 with one wicket left.