The Soviet Union has selected Yuri Dubinin, its envoy to the United Nations, as the new ambassador to the United States, the Soviet news agency Tass reported today.

Dubinin, 55, a career diplomat, took up duties at the United Nations two months ago, following a seven-year tour as ambassador to Spain. He was elected to the middle ranks of Kremlin leadership at the Soviet Communist Party Congress in March, with a seat on the party's Central Auditing Commission, a rung below candidate membership on the powerful Central Committee.

He replaces Anatoliy Dobrynin, 66, whose 24-year career as ambassador to Washington ended in March when he was appointed to a senior party post in Moscow.

Western analysts here were startled by the choice of Dubinin, whose name had never been mentioned in Soviet or western diplomatic circles as a candidate for the job, about which there had been much speculation.

With the surprise choice of Dubinin, a European specialist, Moscow broke with its practice of appointing experts on American affairs and fluent English speakers to its top diplomatic job in Washington. Dobrynin served on the embassy staff there and at the United Nations before taking over the ambassador's post. Former Soviet foreign minister Andrei Gromyko was also viewed as such an up-and-coming specialist before serving as ambassador to Washington in 1943-1946.

Dubinin, who speaks fluent Spanish and French but little English, made his first trip to the United States when he took up his assignment in New York in late March.

Dubinin has a degree in history and began his diplomatic service in 1955. He served in the Soviet Embassy in Paris and was later promoted to head the Foreign Ministry's first European department, with responsibility for Spain, France, Italy and Portugal, before becoming ambassador to Spain in 1978.

He has a wife, Liana, and three daughters.

The silver-haired, dapper Dubinin was described by diplomatic acquaintances here as an "engaging statesman," "a sure-footed spokesman for Soviet policy" and "something of a socialite." After taking up his post in Madrid, he established broad contacts in business, diplomatic and government circles.

"He sought people out," said one senior western diplomat here who knew him well. "He made it a point to keep his range of contacts wide and that earned him a reputation as "a diplomat's diplomat." At his farewell dinner in Madrid, even members of feuding factions of the Spanish Communist Party united to honor him, according to diplomatic sources here.

Like Dobrynin in Washington, during his tour in Spain Dubinin departed from the rigid social form and staid language expected of Soviet officials, according to reports here.

Dubinin's embrace of party leader Mikhail Gorbachev's policies has been swift. He coupled a defense of the Soviet leader's heavily publicized Jan. 15 arms control proposals with an attack on western inflexibility in arms control in a Spanish newspaper article in February.

Reacting to the surprise selection of Dubinin, one senior western diplomat here said he thought the choice "shows a certain will for a fresh approach to the United States."

The fact that a number of experts on U.S. affairs with Washington experience were passed over underlines the diplomat's point. Recently, former ambassador to France Yuli Vorontsov was appointed a first deputy foreign minister, and deputy foreign ministers Georgi Kornienko and Victor Kompletkov were reassigned to jobs in Moscow.

All three are such experts and English speakers who had been considered candidates for Washington. Vorontsov had even told colleagues of his preference for the U.S. posting before he left Paris, diplomats here said.

Dubinin's appointment continues a major reshuffle of jobs involving relations with the United States, which has brought replacements to all the senior U.S.-related jobs in the Foreign Ministry during the past year. In July, Gromyko was replaced as foreign minister by Eduard Shevardnadze, a newcomer to diplomacy with no background in U.S. affairs.

More recently, Dobrynin returned to Moscow as a Communist Party secretary and Alexander Bessmertnykh, head of the U.S. desk, was promoted to deputy foreign minister in charge of American affairs.

Special correspondent Michael J. Berlin added from the United Nations:

Western ambassadors suggested that the Soviet shift of Dubinin from the United Nations to Washington was a last-minute decision that reflected a change in the Kremlin's plans for the appointment of their chief representative in the United States.

The western diplomats, who have worked with Dubinin since he came to the United Nations two months ago, described him as a tough negotiator with sharp edges who does not give anything away and often pushes even beyond his instructions from Moscow.

One American, with long experience in Soviet affairs, said the choice of Dubinin was "a little bizarre because it is not the Russian way to send a man to New York for training; I think it was a correction in the Kremlin's initial choice."

These western ambassadors were reluctant to draw any conclusion from the fact that Dubinin's personal style in negotiations and in his public rhetoric is harsher than his predecessors in Washington, Dobrynin, and at the United Nations, Oleg Troyanovsky. Dubinin was described as being more Russian and less westernized than either; capable of giving offense, showing a lack of sensitivity and "a certain rigidity."

During one closed consultation among Security Council members, for example, Dubinin was said to have questioned the integrity of his French colleague by expressing doubt that he could report objectively to other council members on talks with the Maltese ambassador. This harshness was echoed in pressures Dubinin exercised in negotiations on the renewal of the U.N. peace force in southern Lebanon and a General Assembly struggle over U.N. finances.

But the western diplomats also pointed out that Dubinin can be charming and show his skills as a raconteur on social occasions.