"Japan would like to do its utmost to ease tensions and stabilize the situation in the Middle East," Abe told Rouhani at the start of a meeting between the two leaders in Tokyo.
"As for Iran, I strongly hope the country will fully implement the nuclear agreement and play a constructive role for peace and stability in the region."
Iran, the United States and other countries in 2015 signed the Joint Comprehensive Plan of Action (JCPOA), under which Tehran curbed its uranium enrichment capacity and won sanctions relief in return.
President Donald Trump later withdrew the United States from the deal, which sought to head off any pathway to an Iranian nuclear bomb, and increased sanctions on Iran to pressure its economy by ending its international sales of crude oil.
Iran, for its part, has gradually scaled back its commitments to the deal this year.
At their meeting, Rouhani asked Abe to work with other countries to help keep the nuclear deal in place.
"The nuclear agreement, needless to say, is a very important agreement for Iran. That is all the more reason for me to criticize strongly the United States' unilateral and irrational departure," Rouhani said through a translator.
"I hope Japan and other countries in the world will work hard to help keep the nuclear agreement in place."
Japan, a U.S. ally maintaining friendly ties with Iran, was a leading buyer of Iranian oil for decades before the U.S.-led sanctions.Iran says it has enriched uranium only for civilian purposes, but the United States and the U.N. nuclear watchdog believe it once had a nuclear weapons program that it ended.