The Iranian president, Hassan Rouhani, has put an end to eight years of Holocaust denial under his firebrand predecessor Mahmoud Ahmadinejad by condemning the "crime" of mass killings of Jews by the Nazis.

In an interview after his largely conciliatory speech at the UN general assembly on Tuesday, Rouhani accepted that the Holocaust had taken place and called it reprehensible.

"I've said before that I am not a historian, and when it comes to speaking of the dimensions of the Holocaust, it is the historians that should reflect," Rouhani told CNN's Christiane Amanpour.

"But, in general, I can tell you that any crime that happens in history against humanity, including the crime the Nazis created towards the Jews as well as non-Jews is reprehensible and condemnable. Whatever criminality they committed against the Jews, we condemn."

Rouhani's comments were in marked contrast to those made by Ahmadinejad, who grabbed headlines for making inflammatory statements about the Holocaust during his time in office.

Ahmadinejad repeatedly called the Holocaust a myth and a lie perpetrated by the west.

"They launched the myth of the Holocaust," Ahmadinejad said in a speech at a pro-Palestinian rally in Tehran in September 2009.

"They lied, they put on a show and then they support the Jews … The pretext for establishing the Zionist regime is a lie … a lie which relies on an unreliable claim, a mythical claim, and the occupation of Palestine has nothing to do with the Holocaust."

Meir Javedanfar, an Iranian politics lecturer at Interdisciplinary Centre (IDC) in Herzliya, Israel, interpreted Rouhani's remarks as the limit he could go within the political and cultural constraints placed upon him.

"We could say he is disputing the numbers, which is a valid argument," Javedanfar said. "But he is not saying that six million were not killed. He is saying whatever the numbers, which could be six million or less, was a crime."

Rouhani pushed the envelope as far as it could go, Javedanfar said, without infuriating the supreme leader, Ayatollah Ali Khamenei, and other conservatives back home.

In the CNN interview, Rouhani said that acceptance of the Holocaust did not require the acceptance of the occupation of Palestine by Israel. "This does not mean that on the other hand you can say Nazis committed crimes against a group, now, therefore, they must usurp the land of another group and occupy it. This too, is an act that should be condemned," he said.

During his visit to the UN in New York, Rouhani attempted to revamp the image of Iran so badly hurt under Ahmadinejad. He was accompanied by Iran's only Jewish MP, Siamak Moreh Sedgh, and made no direct mention of Israel in his speech to the general assembly on Tuesday.

Despite the charm offensive, Israel's prime minister, Benjamin Netanyahu, ordered his delegation to boycott Rouhani's speech at the general assembly on Tuesday.