After the 1979 Islamic Revolution, Iran did not change its policy towards Japan, which was not only perceived separately from the West, but was also a major customer of its raw resources and a potential economic donor. In turn, Japan had to pursue the policy of unstable balancing towards Iran, by coordinating its Middle Eastern policy with its strategic ally, the United States, and simultaneously trying to preserve close ties with Iran, which were important from the point of view of maintaining energy security. The article shows how Japan tried to maneuver between these two countries: it took steps to realize large-scale economic projects in Iran’s energy sector, to limit sanctions, which were minimal on its side, etc., and simultaneously participated in the anti-Iran campaign pursued by Western countries under the pressure of the US, or under the influence of major crises in the region (for example, the Iran-Iraq War). Japan continues to face this “Middle Eastern dilemma” in present times as well. It could partly have been solved by the signing of the Joint Comprehensive Plan of Action on the Iranian nuclear program in 2015, were it not for the fact that, two years later, under the US administration of Donald Trump, the US-Iran relations worsened significantly. Nevertheless, in this period, Japan successfully tried its mediatory potential, making use of its good relations with both parties of the conflict: on the one hand, it refused to participate in the US operation in the Strait of Hormuz, on the other, it halted the unfreezing of Iran’s funds in its banks, which had been blocked after the introduction of sanctions by the US administration of Donald Trump. Recently, the activization of China in the region has become a factor of risk for Japan’s Middle Eastern policy, as China tries to use the weaking positions of the US and to occupy the vacuum that was left in its wake, which is illustrated by the signing of the Comprehensive Strategic Partnership agreement between Beijing and Tehran in March 2021. This forces Japan to deliberately strengthen its positions and expand its presence in Iran. It appears that Japan’s approaches to solving the “Middle Eastern dilemma” deserve special attention in the future as well.