Yoko Kamikawa, Japan's foreign minister, has said her country will work with Poland to "end Russia's aggression against Ukraine as soon as possible".
She also talked about bringing a "lasting peace to Ukraine".
Ms Kamikawa has been holding talks in Warsaw with Radek Sikorski, the Polish foreign minister.
She met President Andrzej Duda, too.
Ms Kamikawa began her visit to Poland on Saturday, but interrupted it to go to Ukraine, where she met President Volodymyr Zelenskyy.
Japan announced during her visit that it would contribute £29m to a NATO trust fund to help provide Ukraine with drone detection systems.
Most European Union countries are not giving Ukraine enough weapons, the German chancellor has said.
Olaf Scholz is calling on allies to increase their efforts as the Russian invasion continues.