Aleksei Leonov, the Russian cosmonaut who became the first person to walk in space, a thrilling feat that nearly cost him his life but raised Soviet prestige during the Cold War space race against the United States died on Friday in Moscow. He was 85.

His death was announced by Roscosmos, the Russian space agency, on its website.

The milestone achievement by Mr. Leonov, a major in the Soviet Air Force at the time, showed that men could survive in space outside the confines of their craft and presumably walk on the moon one day.

His spacewalk, in March 1965, was seen by television viewers in the Soviet Union and Europe on videotape. Later in the mission, a live telecast showed Mr. Leonov and a fellow cosmonaut strapped in their seats in the cabin.

The spacewalk enabled the Russians once again to upstage the United States in space; they had launched the first satellite, Sputnik, in October 1957 and the first manned spaceflight into orbit, with Yuri Gagarin, in April 1961.