After years on the brink of national leadership, Yasuhiro Nakasone was preparing today to take over as Japan's prime minister following a stunning victory in primary elections for president of the ruling Liberal Democratic Party.

Nakasone, an urbane politician with a dramatic and straightforward approach that contrasts sharply with the traditional, unobtrusive style of politics here, won 58 percent of the votes cast by the party membership, a margin that forced his three chief rivals to bow out of a final vote.

LDP legislators formally elected Nakasone their new party leader today, in an action that was largely ceremonial.

The rise of Nakasone, 64, to power is not likely to alter substantially the country's cautious approach to dealing with Washington on the thorny issues of trade and defense, in the view of analysts here, although he is expected to stress close ties to the United States.

It could, they said, mean more dynamic leadership and facilitate a clearer statement of the direction of Japanese policy. U.S. officials have complained in the past that the lack of clear signals from Tokyo has complicated efforts to reach accord on key issues.

Nakasone's victory ended a bruising battle within the loose coalition of factions that make up the conservative LDP to name a successor to Prime Minister Zenko Suzuki, who abruptly announced Oct. 12 that he planned to step down. Nakasone comes to power at a time when Japan faces rising protectionism abroad and a need to revive its flagging economy. Japan is also under rising pressure from the United States to boost its military strength at a faster rate.

Speaking to reporters yesterday, Nakasone, who is director general of the government's Administrative Management Agency, said his easy win was a sign that "the Japanese people desire to have more clearly defined policies and stronger leadership."

In final returns tabulated late this afternoon, Nakasone collected more than twice as many votes as the nearest of his three rivals from among the slightly less than 1 million rank-and-file LDP members who cast their ballots by mail.

His closest rival, Toshio Komoto, director general of the Economic Planning Agency, won 27 percent of the vote; Shintaro Abe, minister of international trade and industry, won 8 percent, and Ichiro Nakagawa, director general of the Science and Technology Agency, was last with 7 percent.

Stung by Nakasone's landslide, Komoto and Abe announced yesterday they would drop out of the final round of voting that took place today.

A special session of the Diet, or parliament, convenes Friday to appoint the new prime minister. The LDP's large majority in both houses ensures Nakasone of the premiership.

For the past decade, Nakasone has been widely viewed as a prime candidate for the job, although it has previously eluded his grasp because of his inability to muster support from the political kingmakers who control key LDP factions. Known for many years as a conservative nationalist and a hawk, he has more recently moderated his views.

His popularity within the party has suffered because some detractors have accused him of opportunism. While most of his LDP colleagues shun the limelight, preferring instead to operate behind the scenes in the unobtrusive style of Japanese politics, Nakasone is a dramatic public speaker.

His charismatic qualities, which may fit more the mold of American politicians, have left him open to charges here of showmanship. His style, however, may give the English-speaking Nakasone an advantage in dealing with foreign leaders, some of whom have complained that the Japanese tend to melt into the background when issues of substance are discussed.

In the hotly contested primary race, Nakasone had the strong backing of former prime minister Kakuei Tanaka, who controls the party's largest faction. He was bitterly opposed by Takeo Fukuda, another ex-premier, who threw his support to Komoto.

Nakasone lieutenants were reportedly working late into the night to hammer out a new lineup for top party and government posts aimed at striking an acceptable balance of representatives from contending groups. Nakasone was expected to announce his final choice of Cabinet and party officers following his appointment as prime minister on Friday.

In Japan's consensus-seeking society, stress is placed on avoiding public confrontation while decisions are worked out between competing interest groups behind scenes. The role of a prime minister is largely restricted to carefully sounding out public opinion and then molding the policy preferences of the country's powerful career bureaucrats accordingly.

Nakasone, however, is expected to put a stronger personal stamp on this intricate decision-making process than his predecessor Suzuki.

Nakasone has steadily built up his grasp of issues in a long grooming process for leadership which has included Cabinet portfolios for defense, international trade and industry, and science and technology. He has also served as secretary general of the LDP.

A veteran of the Imperial Navy in World War II, Nakasone was first elected to the Diet in 1947. His former image as a "hawk" has now faded into the background because of a growing public acceptance here of an expanded role for Japan's defense forces at the strong urging of the United States.

Tokyo's military budgets, however, have fallen short of U.S. expectations. Under a self-imposed ceiling, the Japanese limit outlays to less than 1 percent of the gross national product. In a recent interview in the Japanese press, Nakasone suggested that the spending limits may now have to be modestly altered. A sizable increase in defense appropriations would oblige the government to boost taxes, something Nakasone has opposed.