BUDAPEST, JUNE 2 -- President Pal Losonczi will retire and Prime Minister Gyoergy Lazar will be replaced in a reshuffle at the top of the Hungarian leadership, the official radio reported today.

Losonczi, 67, head of state for 20 years, is to be succeeded by Karoly Nemeth, deputy to Communist Party leader Janos Kadar, and Budapest party chief Karoly Grosz will take over from Lazar, the radio said.

Lazar, 62, steps into Nemeth's old job as deputy general secretary, a post that, like the presidency, is of only nominal importance, official sources said.

The changes, decided by the party Central Committee yesterday and ratified by Parliament today, mark a promotion for Grosz, one of two leading contenders to succeed Kadar. The other contender is party propaganda chief Janos Berecz.

Both are 56, nearly 20 years younger than Kadar and regarded by western diplomats and official sources as the kind of vigorous men needed to revive Hungary's faltering economy.

Berecz, a Central Committee secretary, has been promoted to the 13-member Politburo.

"There's no doubt about it. The appointment of Grosz will mean action on the economy," a western observer said.

Hungary has blazed the trail of economic reform in Eastern Europe, but its economy has faltered during this decade, and economists and politicians have called for faster reform.

Other rejuvenating changes in the Hungarian leadership included promotion to the Politburo of Deputy Prime Minister Judit Csehak, 46, and a further step in the rise of Miklos Nemeth, 39, who takes over from his former boss Ferenc Havasi as Central Committee secretary in charge of the economy.

Central Committee secretary Istvan Horvath, another 56-year-old who could succeed Kadar, becomes deputy prime minister.

One political analyst said the moves were a clever balancing act by Kadar, giving younger challengers new jobs that would occupy them for a year or two.

Kadar has led Hungary since taking power in 1956 with the backing of Soviet troops who invaded to put down an anticommunist uprising.