Key Japanese Cabinet ministers agreed at a special meeting today to reach a prompt decision on whether to transfer military-related technology to the United States, a move Prime Minister Yasuhiro Nakasone is believed to be seeking before his scheduled visit to Washington in January.

The Reagan administration, whose relations with Japan have been strained, has long sought the transfer.

At a special session of Nakasone's newly formed Cabinet today, the key ministers agreed to reach a decision quickly on the issue, which has been blocked by a sharp debate among government departments here for the past 18 months, government officials reported. The government action would come "very soon," the officials said, pending further talks among senior administrators aimed at hammering out the details of a possible final proposal.

Today's move was important, observers said, because it may open the way for the full-scale flow of Japan's increasingly important electronics and other high-technology know-how into Pentagon weapons development projects. It comes at a time when U.S. officials remain determined to get Japan to shoulder a greater share of the burden for its defense to offset heavy American military commitments.

In his first speech before the parliament, Nakasone said today, "The United States is Japan's most important partner, and we are bound by strong ties politically, economically, and in a broad spectrum of other fields. I would like to strengthen the relationship of trust between Japan and the United States."

In the speculation of journalists and defense analysts here, Nakasone, who was named prime minister Nov. 26, has ordered his Cabinet officers to move to free the export of Japanese military technology to the United States before he goes to Washington for talks with President Reagan, scheduled for Jan. 18. Under a long-standing policy, Japan bans the export of weapons and related technology.

Faced with huge government deficits, Tokyo has stepped back from the substantial increases in military spending that Washington sought. At the same time, ties between the two countries have suffered because of massive U.S. deficits on trade with Japan. Many top officials here have favored an arrangement for the transfer of defense-related technology to the United States as a means of demonstrating Japan's good faith in easing trade friction and expanding military cooperation.

In talks with newly appointed Foreign Minister Shintaro Abe earlier this week, U.S. Ambassador Mike Mansfield urged Japan to move quickly to put the exchange of military know-how between the two countries on a more "reciprocal" footing. Under the 31-year-old Japanese-U.S. mutual security treaty, the flow of such technology has been overwhelmingly in Japan's favor.

Progress on the issue has been deadlocked here by a feud between powerful government departments. The Ministry of International Trade and Industry, the watchdog of the country's big business interests, has objected strongly to the proposal on the grounds that it would give a major economic rival access to Japan's highly classified advanced industrial technology.

Although U.S. officials have asserted they have no specific items in mind, they have talked broadly about advanced electronics, especially those in use in military aircraft, laser optics and a range of state-of-the-art technologies.

The Foreign Ministry has endorsed the transfer arrangement, citing the importance of the vast, and mostly friendly ties, between the two countries. Senior diplomats have argued that the sale of military technology to the United States would not violate Japan's arms export ban because, as a matter of legal principle, the Japanese-U.S. mutual security pact, an international treaty, takes precedence over purely domestic policy concerns.

Officials, who did not want to be named, suggested that a compromise within government circles here might be achieved by including in any final agreement provisions that would prohibit the United States from exporting defense technology acquired from the Japanese to third countries. Another condition, they said, might bring the flow of such know-how to a halt should the United States be directly involved in a military conflict anywhere.

Defense officials have said that a final agreement would only cover defense-related systems developed under government contract here and leave any decisions on the transfer of technology developed on a purely commercial basis to the discretion of private Japanese companies.

Chief Cabinet Secretary Masaharu Gotoda was quoted in the Japanese press as having told fellow Cabinet members today, "It is not proper that after more than a year of discussions inside the government we still have not reached any solution. We cannot leave things hanging and must have a decision promptly."

Prime Minister Nakasone's apparent determination to guide his subordinates to action on the issue has churned up a heated response from leftist opposition parties in parliament and pacifist elements in the Japanese public who charge that the conservative, ruling Liberal Democratic Party, is trying to dismantle Japan's arms export prohibitions.

In his remarks today, Nakasone stressed that Japan would never become a major military power or "pose any military threat to neighboring countries." Speaking of the need for Japan to meet its increased responsibilities in global affairs, however, he said, "It is impossible to progress toward peace on Earth and co-prosperity for mankind without a Japanese contribution."