After two years of internal planning, maneuvering around U.S. objections and quieting international unease, Japan welcomed Palestine Liberation Organization leader Yasser Arafat here today with a 17,000-strong police security contingent and more than a little embarrassment at the unfortunate timing of the visit.

Arafat's visit originally was conceived as part of a delicate diplomatic balancing act designed to cement Japan's relations with both radical and conservative Arab leaders, according to diplomatic analysts here, and was to be balanced by a visit from Egyptian President Anwar Sadat next month.

But after Sadat's assassination last week, oil-barren Japan's attempts to strike a policy posture toward the energy-rich Middle East independent of the United States seem to have struck rocky ground.

Not only has Sadat's assassination thrown Tokyo's two-tiered policy approach into disarray, Arafat managed to shock officials here who had tacitly agreed to his visit by criticizing Sadat last week in Peking, his second stop on a three-nation Asian trip. The first stop was North Korea.

Thus the trip has touched off a heated political controversy here, with influential members of Prime Minister Zenko Suzuki's Liberal Democratic Party calling for its cancellation. Chief Cabinet Secretary Kiichi Miyazawa indirectly warned Arafat to refrain from making similar provocative statements in Japan, and Foreign Ministry officials have repeatedly emphasized that Arafat is not a "de facto state guest," as implied by Japanese press reports.

But, although the government has stressed that Arafat is the private guest of parliament members, the fact that he is scheduled to meet with Suzuki and Foreign Minister Sunao Sonoda Wednesday has given the visit the trappings of an official state event in all but name.

The substance of the visit is likely to be far outweighed by the simple fact of its taking place. According to diplomatic analysts here, the PLO views the trip as a victory in its efforts to gain international recognition, and Arafat is expected to press demands that the PLO be recognized as the sole representative of the Palestinians and that its Tokyo office be accorded full diplomatic status.

Japanese officials said they will reject such demands and will, instead, call on Arafat to renounce violence as a means of settling disputes and recognize the right of Israel to exist.

Washington did not oppose the visit publicly, but U.S. officials have quietly objected on the grounds that it will not help further the peace process in the Middle East and may damage Japan's image in the United States.

Israel, meanwhile, has said that it regrets the visit. Israeli Ambassador Amnon Ben-Yohanan told reporters in Tokyo last week that it would give the PLO "the chance to come and speak to the Japanese public . . . and Arafat will have the chance to spread his propaganda."

Senior government officials here acknowledge that oil is Japan's "main interest" in the Middle East, which supplies more than 70 percent of its oil and energy needs, but insist that their overtures are not directly tied to energy diplomacy.

"Our basic policy on the Arab-Israeli conflict is not based on our oil interests," said one senior Foreign Ministry official. "We would like to contribute in a modest way to the solution of this global problem."

In inviting Arafat, he said, "We are trying to play a moderating influence on the PLO . . . The fact that Arafat will meet with Prime Minister Suzuki and listen to his moderate views is very important."

In 1974, Japan voted to give the PLO observer status in the United Nations and, two years later, agreed to allow the organization to open an office in Tokyo, without diplomatic status.

Today, Japan, like countries in Western Europe, agrees to the right of Palestinian self-determination but goes a step further in asserting that this gives them the right to an independent state.

Leaders of oil-rich Arab nations, which back the PLO, have made it clear to Japanese businessmen and government officals traveling to the Middle East in recent years that peace and oil supplies are closely tied and that Japan's position on the PLO would be taken into account.

That message was brought home to the Japanese in November 1979 by Mana Saeed Otaiba, oil minister of the United Arab Emirates, who earlier had started negotiations with Japan on the PLO's behalf.

Otaiba arrived in Tokyo today for a one-week stay, ostensibly unconnected with Arafat's visit. But he was expected to amplify such sentiments for the benefit of Japan's oil-dependent business sector, some of whose key leaders Arafat will also meet.

In an apparent attempt to offset cozier ties with the radical Arab group, Tokyo had invited Sadat to make a state visit here Nov. 9, during which it was expected the Japanese would offer Egypt a large economic aid package.

Japan reportedly was prepared to offer nearly $150 million in outright grants for 1982 during Sadat's visit. Since 1973, Tokyo has extended a total of roughly $700 million in yen credits and grants to Cairo.

Following Sadat's death, however, government sources here said that aid plans may be put on ice, pending a review of the political transition in Egypt.

Naoshi Kojima, a senior fellow at the Economic Research Institute for the Middle East, said, "Japan has tried to get the support of the oil-producing countries in the Middle East and the fact that Arafat has visited here means that Japan recognizes the PLO's importance."

But, he said, "Japan's position is very weak," and suggested that the prospects of chaos triggered in the region by Sadat's death may force Japan at least temporarily to revert to a stance more in line with Washington's policy lead.