His court was famous for its scholars and he was often accused of heresy.