MOSCOW (AP) — Veteran Russian cosmonaut Valery Ryumin, who set space endurance records on Soviet missions, then returned to orbit after a long absence to fly on a U.S. space shuttle, has died at the age of 82.

Ryumin went into space four times, including to the space stations Salyut-7 and Mir after becoming a cosmonaut in 1973. He logged a total of 371 days in space in two short missions and two record-setting long-duration flights.

“We have lost a comrade and a friend,” Dmitry Rogozin, the head of the Roscosmos space agency, said in a statement. “This is an irreparable loss for all of us. I express my deepest condolences to the family and friends of Valery Viktorovich. The memory of him will forever remain in our hearts.”

Ryumin, who was born Aug. 16, 1939, in Komsomolsk-on-Amur, made his last flight on a Soviet capsule in 1980, then returned to space 18 years later on the U.S. space shuttle Discovery when it docked with Mir.

“After my three flights in the eighties, I was thinking it would be nice to fly for the fourth time. I thought it would be very useful for a person who has very good flight and life experience, to visit the station,” Ryumin recalled in a NASA oral history quoted by the CollectSpace website. “I will be able to see more details and more things compared to young cosmonauts or crew members.”

Ryumin will be buried Thursday at a military cemetery outside Moscow, the state news agency Tass reported. He is survived by his wife and fellow cosmonaut Yelena Kondakova.