Boris Bondarev, 41, who worked at the UN office in Geneva, said he had "never been so ashamed" of his country in a letter sent to foreign colleagues after he handed in his resignation.
It is a rare political resignation over the war, which started three months ago, and comes at a time when Mr Putin's government is cracking down on criticism.
The war is a crime not just against the Ukrainian people, but also "against the people of Russia, with a bold letter Z crossing out all hopes and prospects for a prosperous and free society in our country," Mr Bondarev wrote in his letter, referring to the widespread use of the letter “Z” as a symbol of support for Russia's war in Ukraine.
“It is intolerable what my government is doing now,” Mr Bondarev said, adding, "as a civil servant, I have to carry a share of responsibility for that, and I don’t want to do that.”
Moscow has not yet commented on the diplomat's resignation, but Mr Bondarev said he was concerned about what the Kremlin's reaction could be.
He had expressed disapproval of the war to Russian colleagues in the past, he said.
“Some said, ‘Everybody disagrees, but we have to keep working' while others replied 'Shut up and stop spreading this bad influence - especially among younger diplomats,'" he said, adding diplomats know they "have to keep their mouths shut."
He suggested he could be made an example of, adding, “if my case is prosecuted, then if other people want to follow, they would not."
Want a quick and expert briefing on the biggest news stories? Listen to our latest podcasts to find out What You Need To Know
Asked if he planned to defect, he chuckled and said, “I didn't think so far” ahead. He also said he has no plans to leave Geneva.
In his statement, Mr Bondarev said those who started the war “want only one thing — to remain in power forever, live in pompous tasteless palaces, sail on yachts comparable in tonnage and cost to the entire Russian Navy, enjoying unlimited power and complete impunity.”
He railed against the growing “lies and unprofessionalism” at Russia's Foreign Ministry and took particular aim at Foreign Minister Sergey Lavrov.
“In 18 years, he (Lavrov) went from a professional and educated intellectual … to a person who constantly broadcasts conflicting statements and threatens the world with nuclear weapons!” he wrote. “Today, the (Russian) Ministry of Foreign Affairs is not about diplomacy. It is all about warmongering, lies and hatred," the diplomat said.
Hiller Neuer, executive director of the advocacy group UN Watch, tweeted a copy of Bondarev's letter and said simply: “Boris Bondarev is a hero.”