The then-prime minister said Mr Putin told him it “would only take a minute”.
Mr Johnson said the comment was made after he warned the war would be an “utter catastrophe” during a “very long” call in February 2022.
Details of the exchange are revealed in a BBC documentary, examining Mr Putin’s interactions with world leaders.
Mr Johnson warned Mr Putin that invading Ukraine would lead to Western sanctions and more Nato troops on Russia’s borders.
He also tried to deter Russian military action by telling Mr Putin that Ukraine would not join Nato “for the foreseeable future”.
But Mr Johnson said: “He threatened me at one point, and he said, ‘Boris, I don’t want to hurt you but, with a missile, it would only take a minute’ or something like that. Jolly.
“But I think from the very relaxed tone that he was taking, the sort of air of detachment that he seemed to have, he was just playing along with my attempts to get him to negotiate.”
President Putin had been “very familiar” during the “most extraordinary call”, Mr Johnson said.
It is impossible to know if Mr Putin’s threat was genuine.
However, given previous Russian attacks on the UK – most recently in Salisbury in 2018 – any threat from the Russian leader, however lightly delivered, is probably one Mr Johnson would have had no choice but to take seriously.
Nine days later, on 11 February, Defence Secretary Ben Wallace flew to Moscow to meet his Russian counterpart, Sergei Shoigu.
The BBC documentary Putin Vs the West reveals Mr Wallace left with assurances that Russia would not invade Ukraine, but he said both sides knew it was a lie.
He described it as a “demonstration of bullying or strength, which is: I’m going to lie to you, you know I’m lying and I know you know I’m lying and I’m still going to lie to you.
“I think it was about saying ‘I’m powerful’,” Mr Wallace said.
He said the “fairly chilling, but direct lie” had confirmed his belief that Russia would invade.
As he left the meeting, he said Gen Valery Gerasimov – Russia’s chief of general staff – told him “never again will we be humiliated”.
Less than a fortnight later, as tanks rolled over the border on 24 February, Mr Johnson received a phone call in the middle of the night from President Zelensky.
“Zelensky’s very, very calm,” Mr Johnson recalled. “But, he tells me, you know, they’re attacking everywhere.”
Mr Johnson says he offered to help move the president to safety.
“He doesn’t take me up on that offer. He heroically stayed where he was.”