RIYADH, Saudi Arabia — The crown prince of Saudi Arabia on Wednesday denounced the “heinous crime” committed against Jamal Khashoggi, the dissident writer killed in Turkey. It was his most public attempt yet to separate himself from Saudi operatives suspected of the killing, who include some of the crown prince’s own aides.

The comments by the crown prince, Mohammed bin Salman, were made during a panel discussion at an opulent investor conference in Riyadh, the Saudi capital. They came as the relationship between Saudi Arabia and Turkey continued to sour over the Oct. 2 killing at the Saudi Consulate in Istanbul, and as Saudi Arabia’s economic and political ties with the West are increasingly at risk.

Prince Mohammed insisted that Turkey and Saudi Arabia were collaborating to bring those who committed the killing to justice.

“The crime was really painful to all Saudis, and I believe it is painful to every human in the world,” he said in Arabic, according to a simultaneous translation. “It is a heinous crime that cannot be justified.”

A Saudi-Turkey split, he said, “will not happen, and we will prove to the world that the two governments are cooperating to punish any criminal, any guilty person, and justice in the end will appear.”

The crown prince’s comments came amid reports by both Saudi and Turkish news agencies that he had spoken by telephone about the Khashoggi case with Saudi Arabia’s principal accuser, President Recep Tayyip Erdogan of Turkey. It was the first official word that the two leaders, considered regional rivals, had spoken about the case.

Earlier in the day, Mr. Erdogan repeated his demand that those responsible for Mr. Khashoggi’s death be brought to justice. “We are determined not to allow a cover-up of this murder,” he said in a speech to Turkey’s State Council.

Some of the crown prince’s close subordinates have been implicated by Turkish officials in the killing of Mr. Khashoggi, 59, a Washington Post columnist.

Western intelligence officials have said the Saudi agents would almost certainly not have acted without the knowledge of or instructions from the 33-year-old crown prince, who is considered the de facto ruler of Saudi Arabia.

For weeks, the Saudi royal authorities insisted that Mr. Khashoggi had left the Istanbul consulate the same day he visited. It was only this past Saturday that the Saudi authorities admitted he had been killed inside the building, describing it as an accident. They said 18 Saudis suspected of involvement had been detained in Saudi Arabia.

Turkish officials have said they have evidence including audio recordings that a team of Saudi assassins killed Mr. Khashoggi within minutes of his entry to the consulate, dismembered his body and then tried to cover up his death — even creating a fictitious trail by having a Saudi agent who resembled Mr. Khashoggi walk out of the consulate wearing the victim’s clothes.

President Trump, a close ally of the Saudi royal family, has said he is skeptical of the Saudi explanations for what happened and has called the cover-up “one of the worst.”

In an interview with The Wall Street Journal on Tuesday, Mr. Trump said that ties between the United States and Saudi Arabia would be damaged if the crown prince had been dishonest with him. “Certainly it would be a very bad thing in terms of relationship,” the president said. “It would take a while to rebuild.”

Mr. Trump’s Central Intelligence Agency director, Gina Haspel, has been in Turkey for the past few days to get more information from her Turkish counterparts.

The Sabah, a pro-government Turkish newspaper, reported that Turkish officials had shared evidence including audio recordings with Ms. Haspel. American intelligence officials would not comment on Ms. Haspel’s meeting.

For the recordings to have real usefulness to the C.I.A. or other agencies, the Turks would have to provide a full copy so American intelligence operatives can perform technical analysis and establish their authenticity. But even then, the recordings would most likely be of little value on the key policy question: whether the Saudi crown prince was connected to the killing, officials briefed on the intelligence said.

The officials said there was little reason to doubt the basic Turkish account of Mr. Khashoggi being brutally murdered in the consulate. But the officials said intelligence agencies remain unconvinced that any of the information gathered from the consulate will resolve the fundamental question of the crown prince’s involvement.

Some government officials believe Prince Mohammed ordered action to be taken against Mr. Khashoggi but did not intend for him to be killed. Others believe Prince Mohammed wanted him killed.

Saudi Arabia has denied that its leaders ordered the operation against Mr. Khashoggi or even knew that it had taken place until days later.

The intrigue surrounding the crown prince’s appearance on a panel at the investment conference was amplified by a fellow panelist, Prime Minister Saad Hariri of Lebanon, who nearly a year ago was detained in Saudi Arabia, apparently on the orders of the crown prince. The strange circumstances surrounding Mr. Hariri’s visit back then caused an international stir, but the two men appear to have made up since Mr. Hariri’s release.

Mr. Hariri did not address the incident, instead focusing his remarks on the development of Lebanon’s economy. But Prince Mohammed sought to joke about it.

“His Excellency Prime Minister Saad is staying for two days in Saudi Arabia,” the crown prince said, “so I hope that rumors don’t start that he’s been kidnapped.”

Mostly, the crown prince used the appearance to promote what he described as his country’s rich and glorious future.

“I don’t think that there is any challenge before the great Saudi people,” he said. “All of our projects are proceeding, reform is proceeding, our war on extremism is proceeding, our war on terrorism is proceeding, developing the kingdom of Saudi Arabia is proceeding. No matter how they try to stop our efforts, we won’t stop.”

He suggested that the countries of the Middle East could one day form an economic engine like Europe. And in a surprising note of magnanimity, the crown prince said that even Qatar — a neighboring adversary targeted by a Saudi-led embargo — had a dynamic economy that would play an important role in the future of the region.

Prince Mohammed was greeted with an ovation as he entered the ballroom at the Ritz Carlton hotel, where business leaders from around the world have converged to network and make deals — though many canceled last week, citing the stigma of the Khashoggi scandal.

Throughout the day, bankers and business executives at the conference, known as the Future Investment Initiative, wondered whether the prince would actually make an appearance, which was added and then mysteriously disappeared from the conference’s online agenda.

Despite the Khashoggi uproar, the conference hummed along on its second day, with discussions focused on capital markets, sovereign wealth funds and investing in Saudi Arabia’s emerging technology sectors.

Although pitches were being made in the hotel’s hallways, it was premature to say whether the absence of top American bankers would be a drag on deal making or open new opportunities for investors from Russia and China.

On Tuesday, Saudi Aramco announced the signing of 15 deals worth more than $30 billion with companies in eight countries: the United States, France, China, Japan, the United Arab Emirates, Britain, South Korea and India.

It remains to be seen whether the crown prince’s remarks about Mr. Khashoggi will allay the lingering concerns.

“It was something he had to do in some form,” said Ralph Simon, the chief executive Mobilium Global, a London-based mobile technology company. “There was a lot of opposition to people coming to this event and I was hoping there would be some form of public statement.”

But the shifting Saudi statements on Mr. Khashoggi have in some ways only deepened foreign suspicions about the crown prince’s role. They were fanned further by a social-media backlash on Wednesday over published photographs of a staged condolence gesture by the crown prince, shown shaking hands with Salah Khashoggi, a son of the slain journalist, who is barred from leaving the kingdom.

Mr. Rouhani also suggested the killers had been emboldened and encouraged by the United States, which regards Saudi Arabia as its principal Arab ally. “I don’t think any country dares to commit such a crime without a green light from the U.S.,” he was quoted as saying.

Saudi officials at the investment conference tried to keep the focus off Mr. Khashoggi’s killing and on their big plans for the kingdom.

“It was a tragedy and a very shocking moment for all for all of us, and I think everyone has to make the decision for themselves,” said Princess Reema bint Bandar Al Saud, who had just given a talk about her work with the Saudi sports authority.

“There are 33 million people in this country who are trying very hard to move this country forward, and we have a very clear vision,” she said. “This is why we are telling people to take the initiative to invest in our future.”

Reporting was contributed by Ben Hubbard from Beirut, Lebanon; Carlotta Gall from Istanbul; David D. Kirkpatrick from London; Julian E. Barnes from Washington; and Rick Gladstone from New York.

A version of this article appears in print on , Section A, Page 1 of the New York edition with the headline: At Saudi Event, Prince Deplores ‘Heinous Crime’. Order Reprints | Today’s Paper | Subscribe