A senior adviser to President Volodymyr Zelensky said on Friday that Russia hit Ukraine this week with missiles supplied by North Korea for the first time during its invasion.
Kim expressed sympathy to Iranian President Ebrahim Raisi and reaffirmed North Korea's stand in "opposing all sorts of terrorism," KCNA said.
North Korea has been under a United Nations arms embargo since it first tested a nuclear bomb in 2006.
South Korea's military conducted "corresponding" live firing drills on Friday in response to the shelling.
Russia is now closer to acquiring Iranian ballistic missiles from Tehran just days after launching North Korean-made missiles into Ukraine, according to the US.
"If the enemy opt for military confrontation ... our army should deal a deadly blow to annihilate them thoroughly," KCNA news agency quoted Kim as saying.
North Korea vowed to launch three new spy satellites, build military drones, and boost its nuclear arsenal in 2024 as leader Kim Jong Un said US policy is making war inevitable.