In the letter dated 9 October, and sent after US troops were pulled out of Syria, Mr Trump told Mr Erdogan: “Don’t be a tough guy. Don’t be a fool!”
Turkish presidential sources told BBC Turkish that the letter was “thoroughly rejected” by Mr Erdogan.
On the day the letter was received, Turkey launched a cross-border offensive against Kurdish-led forces.
“Let’s work out a good deal! You don’t want to be responsible for slaughtering thousands of people, and I don’t want to be responsible for destroying the Turkish economy – and I will,” Mr Trump said in the letter.
“History will look upon you favourably if you get this done the right and humane way. It will look upon you forever as the devil if good things don’t happen.”
In response, Turkish presidential sources said: “President Erdogan received the letter, thoroughly rejected it and put it in the bin.”
It is hard to imagine language like it in many letters between presidents.
Donald Trump’s mixture of threats and locker-room banter infuriated Turkey’s President Recep Tayyip Erdogan. His staff told the BBC that he threw the letter into the bin and launched the Syrian operation the same day. That could be proof there was no Trumpian green light.
But ever since President Obama partnered up with the Syrian Kurds of the SDF against the jihadists of IS it was clear the arrangement would lead to problems with the Turks. That’s because the SDF is very close to the Turkish Kurds of the PKK. Turkey says they are two halves of the same terror group.
Presidents Erdogan and Trump discussed military action last December. Diplomatic sources here in Ankara suggest that Turkey’s broader strategic objective was to detach the Kurds and the Americans.
That, at any rate, has happened.
The diplomatic debacle that has surrounded events in and around Syria is the background to President Erdogan’s meeting in Ankara with a US delegation headed by Vice-President Mike Pence, with Secretary of State Mike Pompeo. It is hard to find common ground between the two sides.
President Trump has faced intense criticism for the withdrawal of troops, which critics say gave Turkey the green light to launch the military attack.
Much of the criticism has come from within Mr Trump’s own party.
In a rare bipartisan rebuke, 129 members of the president’s Republican Party in the House of Representatives joined Democrats to formally denounce the move in a vote on Wednesday.
The joint resolution, which also called on President Erdogan to immediately cease military operations against Kurdish-led forces, was voted in by 354-60.
House Speaker Nancy Pelosi also held an apparently explosive meeting with President Trump on the issue, which led to her and Senate Minority Leader Charles Schumer walking out of the room.
Republican leaders said Ms Pelosi’s behaviour was “unbecoming”, and criticised her for “storming out”.
Ms Pelosi and Mr Trump also each accused the other of having a “meltdown”, with the president later tweeting a photo of their confrontation.
Earlier on Wednesday, President Trump said the US should not be intervening in Turkey’s military operation in Syria because it is “not our border”, and called the former US allies the Kurds “no angels”.
“They have a problem at a border,” he told reporters at the White House. “It’s not our border. We shouldn’t be losing lives over it.”
The president also said he thought the situation on the Turkey-Syria border was “strategically brilliant” for the US.
“Our soldiers are out of there. Our soldiers are totally safe. They’ve got to work it out. Maybe they can do it without fighting,” he said.
“We’re watching and we’re negotiating and we’re trying to get Turkey to do the right thing, because we’d like to stop wars regardless.”
On the Kurds, he added: “They fought with us. We made a lot of money for them to fight with us, and that’s okay. They did well when they fought with us. They didn’t do so well when they didn’t fight with us.”
Kurdish-led forces have been a critical ally of the US in the fight against the Islamic State (IS) group in Syria.
However, there are fears that this destabilisation could lead to a jihadist resurgence.
Turkish troops and allied Syrian rebels launched the offensive in northern Syria last week against members of a Syrian Kurdish militia, called the People’s Protection Units (YPG).
The aim, they said, was to push the YPG back from the border, and to create a “safe zone” where up to two million Syrian refugees can be resettled.
On Wednesday, Mr Trump also said that a rebel group that fights for Kurdish autonomy in Turkey – called the Kurdistan Workers’ Party (PKK) – was “probably worse at terror and more of a terrorist threat in many ways than” IS.
The PKK is already designated as a foreign terrorist organisation by the US, and a Specially Designated Global Terrorist Entity.
Turkey sees the YPG as an extension of the PKK – a claim the US rejects. However the US has previously acknowledged links between the PKK and YPG.
The YPG makes up a large part of an alliance of Kurdish and Arab militias, called the Syrian Democratic Forces (SDF), which has helped to drive IS out of a quarter of Syria over the past four years