Consul General Mohammed al-Otaibi left Turkey on Tuesday afternoon, state media reported, just as police began putting up barricades around his official residence.
Saudi Arabia previously called the allegation "baseless", but United States media reports suggest the Saudis may soon acknowledge Khashoggi was killed there, perhaps as part of a botched interrogation.
Trump told the CBS news show 60 Minutes on Sunday that Saudi Arabia would face "severe punishment" if it is determined Khashoggi was killed inside the Saudi consulate, but Riyadh dismissed the USA threat and said it would retaliate if Trump took any action against Saudi Arabia.
Speaking after Turkish police entered the consulate for the first time and searched the premises for nine hours, Erdogan also told reporters that they were looking into toxic materials at the mission.
Pompeo landed in Riyadh on Tuesday morning and was due to meet the king immediately to discuss the crisis surrounding Khashoggi, who vanished two weeks ago during a visit to the Istanbul consulate.
King Salman emphasised the importance of the Turkey-Saudi relationship and said no-one should be able to "undermine the strength of this relationship", Saudi's official media reported.
On Oct. 2, Khashoggi went to the consulate general of Saudi Arabia in Istanbul for some documents.More news: Honduras takes action against migrant caravan after Trump threatens to cut aid
Turkish officials have said evidence was found during the search. Trump himself said without offering evidence that Khashoggi could have been murdered by "rogue killers", offering the US-allied kingdom a possible path out of a global diplomatic firestorm.
The US secretary of state, Mike Pompeo, has arrived in Saudi Arabia for talks with King Salman over the disappearance of the journalist Jamal Khashoggi, as reports emerged that Riyadh was poised to acknowledge that Khashoggi was killed in its consulate in Istanbul.
Khashoggi had been anxious that the Saudi government wanted him dead, The New Yorker's Robin Wright wrote last week. Saudi statements up to now have dismissed allegations of a killing as "baseless" and "lies". "We face our challenges together", the crown prince said as he warmly welcomed Pompeo at the palace.
"His denials to me could not have been stronger", Trump said at the White House.
In a statement, Bachelet welcomed the investigators being given access to the consulate, despite a two-week delay, and called on authorities of both countries to ensure that "no further obstacles are placed in the way of a prompt, thorough, effective, impartial and transparent investigation".
Saudi officials have been in and out of the building since Khashoggi's disappearance without being stopped.
US Senator Lindsey Graham, pictured with fellow Republican Senator Marco Rubio in Washington in 2014, described Crown Prince Mohammed bin Salman as a "wrecking ball".More news: Meghan and Harry delighted by unusual gift
While lurid claims have appeared in Turkish media - including that Khashoggi was tortured and dismembered - Turkey's leadership has so far refrained from pointing the finger directly at Riyadh in public comments.
Trump, who dispatched Pompeo to speak to the monarch over Khashoggi's disappearance, said after talking with King Salman that the slaying could have been carried out by "rogue killers".
Pompeo then met a smiling Prince Mohammed, the 33-year-old heir apparent to the throne of the world's largest oil exporter.
Turkey had wanted to search the consulate for days.
King Salman ordered an investigation into the missing journalist on Monday.
The kingdom has also angrily rejected what it called political and economic "threats", saying it would respond to any punitive action, such as sanctions, "with a bigger one". Several countries are calling for a response while US President Donald Trump has threatened severe punishment against the Middle Eastern Kingdom. On Sunday, the oil-rich kingdom suggested retaliation if the USA were to impose strict measures.More news: Trump praises congressman who assaulted reporter