Saudi Arabia's Crown Prince Mohammed bin Salman said Wednesday that the killing of writer Jamal Khashoggi was a "heinous crime that cannot be justified."

"The crime was really painful to all Saudis and I believe it is painful to every human in the world," he said at an economic conference in Riyadh.

The crown prince said that all perpetrators would be taken to court and that “justice will be seen in the end.”

Crown Prince Mohammed's remarks on the killing were his first since Saudi Arabia acknowledged last week that Khashoggi was killed.

He was addressing the Future Investment Initiative, a glittering gathering aimed at showcasing oil-rich Saudi Arabia as a moderate, high-tech mecca.

The crown prince, 33, said many people were trying to use the incident to “drive a wedge” between Saudi Arabia and Turkey.

“I want to send them a message,” he said. "They will not be able to do that as long as there is a king called King Salman bin Abdulaziz and a crown prince called Mohammed bin Salman in Saudi Arabia and a president in Turkey called Erdogan.”

The crown prince spoke on a panel alongside Lebanese Prime Minister Saad Hariri and Bahraini Crown Prince Salman bin Hamad bin Isa Al Khalifa. Hariri temporarily resigned as prime minister during a visit to Saudi Arabia last year, prompting some Lebanese officials to accuse the kingdom of forcing his hand and detaining him in the country for days.

The crown prince joked Wednesday that Hariri was staying in the kingdom for two days. "So I hope you don't spread rumors that he was kidnapped," he said, according to Reuters.

Crown Prince Mohammed's comments came as Saudi Arabia sought to contain a firestorm of criticism over its handling of Khashoggi's disappearance after he entered the Saudi Consulate in Istanbul on Oct. 2.

Late Tuesday, Saudi officials added another detail to the kingdom’s evolving explanation about the journalist’s killing. Officials told NBC News that the original plan was to hold Khashoggi against his will for up to two days in a safe house in Turkey while persuading him to return to Saudi Arabia.

Saudi Arabia has acknowledged that Khashoggi was killed inside the consulate, but has maintained that his death was a mistake when an attempt by operatives to persuade him to return home escalated into a fatal fistfight.

Turkish authorities have disputed the Saudi's account, with President Recep Tayyip Erdogan saying Tuesday that he believes Khashoggi’s murder was “premediated.”

“It appears that the squad who planned and executed the murder had been informed of Jamal Khashoggi’s visit," Erdogan added.

The Saudis have consistently maintained that the crown prince had no prior knowledge of the operation, despite the involvement of some of his top aides. Saudi Foreign Minister Adel al-Jubeir, told Fox News on Sunday that it was a “rogue operation" in which individuals exceeded their authority.

But U.S. officials told NBC News last week that American intelligence agencies believe it's inconceivable that the crown prince had no connection to his Khashoggi's death but that they still have no "smoking gun" evidence that he ordered the journalist killed.

On Tuesday, the crown prince received a standing ovation when he made an unannounced stop at the investment conference. He also appeared at an afternoon panel next to King Abdullah II of Jordan, but made no public remarks.

In recent days, a slew of businesses leaders and media companies announced that they were pulling out of the Riyadh meeting, dubbed "Davos in the Desert."

Earlier Tuesday, the Saudi king and crown prince met two of Khashoggi’s sons at the Yamama Palace in Riyadh.

Saudi Crown Prince Mohammed bin Salman meets with Jamal Khashoggi's sons Salah and Sahel in Riyadh on Tuesday. Saudi Press Agency / AFP - Getty Images

The crown prince has discussed Khashoggi's disappearance with President Donald Trump by phone and has met with Secretary of State Mike Pompeo and Treasury Secretary Steve Mnuchin in Riyadh.

On Oct. 3, the crown prince told Bloomberg that his understanding was that the journalist had left the consulate after "a few minutes or one hour" and that Saudi Arabia was investigating through its Foreign Ministry "to see exactly what happened at that time."

“We have nothing to hide,” the crown prince was quoted as saying by Bloomberg.

Saudi Arabia's absolute monarchy is a longtime U.S. ally and considered a bulwark against Iran, but the crisis over Khashoggi's death has helped crystallize growing unease about the crown prince.

Trump said Tuesday that the effort to conceal Khashoggi's killing was the "worst cover-up ever."

Shortly after Trump's remarks, Pompeo said 21 Saudi officials deemed by the U.S to be responsible for Khashoggi’s death would have their U.S. visas revoked or be ineligible for a visa to enter the U.S.

Pompeo also said the Trump administration was looking into the possibility of slapping sanctions on some Saudi officials under the Global Magnitsky Act, which punishes human rights violators.