Hillary Clinton joked that the letter had been "found in the archives."

Hillary Clinton on Sunday posted a joke letter on Twitter supposedly sent by John F. Kennedy during the 1962 Cuban missile crisis, written in the excitable style of US President Donald Trump's recent letter to Turkey.

The parody letter, which has been doing the rounds for some days on social media, is written on mocked-up White House letter paper and addressed to Russia's then leader Nikita Khrushchev.

"Don't be a d***, ok? Get your missiles out of Cuba," starts the letter pretending to be from president Kennedy.

"Everybody will say 'Yay! Khrushchev! You're the best!' But if you don't everybody will be like 'what an a******' and call your garbage country 'The Soviet Bunion'."

The letter echoes the bizarre tone of Trump's October 9 letter to Turkish President Recep Tayyip Erdogan in which he warned that he would wreck Turkey's economy if its invasion of Syria went too far.

"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," Trump wrote in a letter many people thought was fake until it was verified by the White House.

"Don't be a tough guy. Don't be a fool," Trump finished, adding: "I will call you later."

The joke letter from Kennedy to Khrushchev ends: "You're really busting my nuts here. Give you a jingle later" before signing off "Hugs, John Fitzgerald Kennedy."

Clinton joked that the letter had been "found in the archives."

Democrat Clinton, who was defeated by Republican Trump in the 2016 US election, has backed efforts to impeach him over his dealings with Ukraine and is still regularly targeted by the president during his speeches.

In the 1962 Cuban missile crisis, Kennedy and Khrushchev faced off in a moment of high diplomatic tension that threatened to tip the world into nuclear war.

The United States had detected Soviet missile installations in Cuba, just miles off the Florida coast, and Kennedy imposed a blockade of the island.

Soviet ships laden with nuclear missiles heading for Cuba turned back at the last minute after a secret agreement with Washington.

Trump has defended his diplomacy in the Middle East and his military pullout from northern Syria, which triggered Turkey's cross-border attack against Kurdish forces.