Japan's Cabinet yesterday bowed to pressure from Prime Minister Yasuhiro Nakasone and agreed to convene a special session of parliament June 2, a step that is widely expected to lead to the first general election in Japan in 2 1/2 years.

The decision ended three weeks of intense negotiations between Nakasone and leaders of the ruling Liberal Democratic Party (LDP) who hope to replace him as prime minister.

Party officials have said publicly in recent days that during the negotiations Nakasone indicated through an emissary that he would not try to use the election results to win himself an extension in office this fall, when his current term expires.

But analysts in Tokyo pointed out that if the party scores major gains in the elections, expected to take place on July 6, some may believe that it would make no sense to change leaders when things were going so well.

Whatever the outcome concerning his future, the decision for the June 2 special session was a major victory for Nakasone, who is highly praised by the Reagan administration. Now in his fourth year in office, Nakasone is the most enduring Japanese prime minister in 15 years but is under pressure from three so-called leaders rising from the ranks below.

Three weeks ago, as he took heavy fire within the party for failing to win concessions for Japan at the seven-nation economic summit in Tokyo, it was widely dismissed in political circles in Tokyo as impossible that he would get his way on holding elections.

"The LDP has a tradition of uniting during an emergency," a smiling Nakasone said at a business party in Tokyo last evening, after the decision. "We have proved that again today and I am really grateful."

An election for half the seats in the Upper House of the Diet, as the parliament is called, had already been scheduled for this summer. For the past year, political analysts had been speculating that Nakasone would seize the opportunity to dissolve the Lower House, the more powerful of the two chambers, and hold a vote together.

With many seats up for grabs, turnout would probably be high, it was said, a condition that normally favors the LDP. No one expected the party to lose its control, but if it did particularly well, gaining seats, then Nakasone's own status and long-shot chances for an extension would be enhanced. Nakasone's rivals have been against it for just that reason.

The ostensible purpose of the special session will be consideration of measures to aid export-oriented companies that have been hard hit by close to a one-third drop in the value of the dollar against the yen since last September that has made their products more expensive abroad. It is expected that the Diet will be dissolved as soon as it passes the bill.

It was not clear why Nakasone's rivals backed off. But possible pledges to Finance Minister Noboru Takeshita and Foreign Minister Shintaro Abe that Nakasone would bow out as scheduled have been cited. Another was pressure from party members who had already begun unofficial reelection campaigns and spent large sums of money.

A rise of the dollar from 160 to almost 170 yen following remarks by U.S. Treasury Secretary James Baker 10 days ago on a need for "stability" also aided Nakasone, analysts said.