In March 1965, at the age of 30, Soviet cosmonaut Alexei Leonov made the first spacewalk in history, beating out American rival Ed White on Gemini 4 by almost three months. Floating outside his tiny Voskhod 2 capsule for 10 exhilarating minutes, Leonov felt, he writes, “like a seagull with its wings outstretched, soaring high above the Earth.” In keeping with the secrecy of the Soviet space program, few people—not even his family—knew about the spacewalk ahead of time. Even less well known was how close Leonov and his crewmate, Pavel (Pasha) Belyayev, came to dying that day. In his recently published book, Two Sides of the Moon, written with U.S. Apollo astronaut David Scott, Leonov recounts the spacewalk and its even more dramatic aftermath.

When my four-year-old daughter, Vika, saw me take my first steps in space, I later learned, she hid her face in her hands and cried.

“What is he doing? What is he doing?” she wailed. “Please tell Daddy to get back inside.”

My elderly father, too, was upset. Not understanding that the purpose of my mission was to show that man could survive in open space, he expressed his distress to journalists who had gathered at my parents’ home.

“Why is he acting like a juvenile delinquent?” he shouted in frustration. “Everyone else can complete their mission properly, inside the spacecraft. What is he doing clambering about outside? Somebody must tell him to get back inside immediately. He must be punished for this.”

His anger soon gave way to pride when he heard a live broadcast of President Leonid Brezhnev’s message of congratulations beamed up to me from the Kremlin via mission control.

“We members of the Politburo are here sitting and watching what you are doing. We are proud of you,” Brezhnev said. “We wish you success. Take care. We await your safe arrival on Earth.”

As I pulled myself back toward the airlock, I heard Pasha talking to me: “It’s time to come back in.” I realized I had been floating free in space for over 10 minutes. In that moment my mind flickered back for a second to my childhood, to my mother opening the window at home and calling to me as I played outside with my friends, “Lyosha, it’s time to come inside now.”

With some reluctance I acknowledged that it was time to reenter the spacecraft. Our orbit would soon take us away from the sun and into darkness. It was then I realized how deformed my stiff spacesuit had become, owing to the lack of atmospheric pressure. My feet had pulled away from my boots and my fingers from the gloves attached to my sleeves, making it impossible to reenter the airlock feet first.

I had to find another way of getting back inside quickly, and the only way I could see to do this was pulling myself into the airlock gradually, head first. Even to do this, I would carefully have to bleed off some of the high-pressure oxygen in my suit, via a valve in its lining. I knew I might be risking oxygen starvation, but I had no choice. If I did not reenter the craft, within the next 40 minutes my life support would be spent anyway.

The only solution was to reduce the pressure in my suit by opening the pressure valve and letting out a little oxygen at a time as I tried to inch inside the airlock. At first I thought of reporting what I planned to do to mission control. But I decided against it. I did not want to create nervousness on the ground. And anyway, I was the only one who could bring the situation under control.

But I could feel my temperature rising dangerously high, with a rush of heat from my feet traveling up my legs and arms, due to the immense physical exertion all the maneuvering involved. It was taking far longer than it was supposed to. Even when I at last managed to pull myself entirely into the airlock, I had to perform another almost impossible maneuver. I had to curl my body around in order to close the airlock, so Pasha could activate the mechanism to equalize pressure between it and the spacecraft.

Once Pasha was sure the hatch was closed and the pressure had equalized, he triggered the inner hatch open and I scrambled back into the spacecraft, drenched with sweat, my heart racing.

The serious problems I had experienced when reentering the spacecraft were, thankfully, not televised. From the moment our mission looked to be in jeopardy, transmissions from our spacecraft, which had been broadcast on both radio and television, were suddenly suspended without explanation. In their place Mozart’s Requiem was played again and again on state radio. My family was therefore spared the anxiety they would have had to endure had they known how close I came to being stranded in space. They were also spared the trauma they would have suffered had they known the grave danger that Pasha and I faced in the hours that followed. For the difficulties I experienced reentering the spacecraft were just the start of a series of dire emergencies that almost cost us our lives.

Just five minutes before our retro-engine was due to start dropping us out of orbit, I checked our instruments and realized our automatic guidance system for reentry was not functioning correctly. We would have to switch off the automatic landing program. This meant we would have to orient the spacecraft before reentry manually, and would also have to select our landing point manually and decide on the exact timing and duration of the retro-rocket firing. We knew our landing would have to be performed during our next orbit and that, despite our best efforts, we would be coming down off-target—1,500 kilometers [930 miles] west of where we were supposed to land.

As our orbit brought us above the Crimea, we received the first ground control communication we’d had in some time. “How are you, Blondie? Where did you land?” It was Yuri Gagarin; he always called me “Blondie.” It was good to hear his voice. Even in such difficult circumstances he sounded full of warmth, even relaxed. But from what he was saying, it was clear mission control thought we had already landed.

Pasha clicked on his microphone. “We had to turn off the automatic landing system. We have only enough fuel to do one correction, and besides that, the indicator shows that the main engine for reentry is very low on fuel,” Pasha reported in as steady a voice as he could. “We can make only one attempt at reentry. We are asking you therefore to go into emergency mode.”

It was my job, as navigator, to determine where we would land. Our orbit would take us right over Moscow; we could set down in Red Square. But we had to choose somewhere as sparsely populated as possible. I decided on an area close to the city of Perm, just west of the Ural Mountains. Even if I miscalculated and our orbit took us beyond Perm, we should still be able to land in Soviet territory. We could not run the risk of overshooting so much that we came down in China; relations with the People’s Republic were poor at the time.

Pasha began orienting the craft for reentry. This was no easy task—in order to use the optical device necessary for orientation, he had to lean horizontally across both seats in the spacecraft, while I held him steady in front of the orientation porthole. We then had to maneuver ourselves back into the correct positions in our seats very rapidly so that the spacecraft’s center of gravity was correct during the reentry burn. As soon as Pasha turned on the engines we heard them roar and felt a strong jerk as they slowed our craft. According to the flight schedule, our landing module would separate from the orbital module 10 seconds after retro-fire. I counted the seconds down in my head.

But something was very wrong. It felt as if we were being dragged from behind, as if something was pulling us back. When we began to reenter the Earth’s atmosphere, we started to feel gravity pulling us in the opposite direction. The conflicting forces—my instruments indicated 10 Gs—were so strong that some of the small blood vessels in our eyes burst. Looking out my window, I realized with horror what was happening. A communication cable connected the landing module with the orbital module, and as we rapidly entered the denser Earth atmosphere, the cable had become the two modules’ common center of gravity, and we were spinning around it.

The spinning eventually stopped at an altitude of about 100 kilometers, when the connecting cable burnt through and our landing module slipped free. Then we felt a sharp jolt as first the drogue chute and then the landing chute deployed. Everything became very peaceful, very calm. We could hear and feel the wind whistling in the straps as the module swung gently on the landing chute.

Suddenly everything became dark. We had entered cloud cover. Then it grew even darker. I started to worry that we had dropped into a deep gorge. There was a roaring as our landing engine ignited just above the ground to break the speed of our descent. Finally we felt our spacecraft slumping to a halt. We had landed in two meters of thick snow.

Our orientation system indicated that we had landed 2,000 kilometers beyond Perm, in deepest Siberia. “How soon do you think they’ll pick us up?” Pasha asked me, concerned, as the landing module shuddered to a standstill.

I tried to make light of our situation. “In three months, maybe, they’ll find us with dog sleighs.”

We had to get out of the spacecraft to assess our location, but that was not easy. When we flicked the switch to open the landing hatch, the explosive bolts holding it shut were activated and a smell of gunpowder filled the cabin. But, though the hatch jerked, it failed to open. Looking out of the window, we could see the hatch was jammed against a big birch tree. We had no alternative but to start rocking the hatch violently back and forth, trying to shift it clear of the tree. Then, using all his strength, Pasha managed to push the hatch away from the remains of the bolts, and it slid back and disappeared into the snow.

We took in a deep draught of fresh air and felt our lungs contract with the sudden blast of cold. After so many emergencies, the relief at drawing breath on Earth again was indescribable. We threw our arms round each other, slapping each other on the back as best we could in our bulky spacesuits.

We both squeezed out through the hatch, and sank up to our chins in snow. Looking up, we could see we were in the middle of a thick forest, a taiga of fir and birch. I tried to determine our approximate location by measuring the sun’s height above the horizon. But it soon disappeared behind the clouds. The sky grew darker and it started to snow, so we sought shelter back in the spacecraft.

Fortunately, Pasha and I were used to harsh climates. He had been born in the Vologda region, north of Moscow, and had spent much of his childhood hunting in the forest close to his home; his first ambition had been to become a hunter. I, dreaming of becoming an artist, had spent my childhood in central Siberia.

We were only too aware that the taiga where we had landed was the habitat of bears and wolves. It was spring, the mating season, when both animals are at their most aggressive. We had only one pistol aboard our spacecraft, but we had plenty of ammunition. As the sky darkened, the trees started cracking with the drop in temperature—a sound I was so familiar with from my childhood—and the wind began to howl.

Even though mission control had no idea where we were or whether we had survived, our families were informed that we had landed safely and were resting in a secluded dacha before returning to Moscow. Our wives were advised to write us letters welcoming us home.

We had no idea if our rescue signal had been received. It turned out later that Moscow had not received it, but it had been picked up by listening posts as far away as Bonn, Germany. More importantly, a cargo plane flying close to our landing site had also picked it up. A search party had been dispatched, and late in the afternoon, we picked up the sound of a helicopter approaching. We plowed through the thick snow into a clearing and stood waving our arms. The pilot spotted us. But we soon realized it was a civil aircraft, not a military one. He and his crew would have no idea how to rescue us.

They saw it differently. Eager to help, they tossed a rope ladder down to us and signaled that we should grab it and clamber aboard. It was impossible. It was a flimsy ladder and our spacesuits were too heavy and stiff to allow us to scale its rungs.

As news of our whereabouts was relayed from pilot to pilot in the area, more aircraft started to circle above us. There were so many at one point that we worried one would collide with another. But the pilots meant well. A bottle of cognac was tossed out of one plane; it broke when it landed. A blunt axe was thrown from another. Of far more use were two pairs of wolf-skin boots, thick pairs of trousers, and jackets. The clothes got caught in branches, but we managed to retrieve the warm boots and pulled them on.

But the light was failing fast and we realized we would not be rescued that night. We would have to fend for ourselves as best we could. As it grew darker the temperature dropped rapidly. The sweat that had filled my spacesuit while I was trying to reenter the capsule after my spacewalk was sloshing around in my boots up to my knees. It was starting to chill me. I knew we would both risk frostbite if we did not get rid of the moisture in our suits.

We had to strip naked, take off our underwear, and wring the moisture out of it. We then had to pour out what liquid had accumulated in our spacesuits. We went on to separate the rigid part of the suit from its softer lining—nine layers of aluminum foil and a synthetic material called dederone—and then put the softer part of the suits back on over our underwear and pull our boots and gloves back on. Now we could move more easily.

We tried for a long time to pull our capsule’s vast parachute out of the trees so we could use it as extra insulation. It was exhausting work, and we were forced to rest briefly in the snow. But as it grew even darker, the temperature dropped further still, and it began to snow much more heavily. There was nothing to do but return to the capsule and try to keep as warm as we could. We had nothing to cover the gaping hole left by the detached exit hatch, and we could feel our body heat dropping sharply as the temperature plummeted to below –22 degrees Fahrenheit.

The next morning we woke to the sound of an airplane circling overhead. Above the roar of the engines we could just hear voices in the distance. I took a signal gun and fired a flare. Slowly, a small group of men on skis came into view. Led by local guides, the rescue party included two doctors, a fellow cosmonaut, and a cameraman, who began filming as soon as he saw us.

It was to be another 24 hours before another team of rescuers could chop down enough trees to make a clearing big enough for a helicopter to land. We would have to survive another night in the wild, but this night was a great deal more comfortable than the first. The advance party chopped wood and built a small log cabin and an enormous fire. They heated water for us to wash in a large tank flown in especially by helicopter from Perm. And they laid out a supper of cheese, sausage, and bread. After three days with little food, It seemed like a feast.

By the next morning, we were ready to ski nine kilometers to a clearing where a helicopter was standing by to fly us to Perm. From there we were flown to our launch site at Baikonur, where we disembarked to find a large group waiting for us, headed by Sergei Korolev, our chief, and Yuri Gagarin. At first they looked serious, and seemed confused by our heavy jackets, polar hats, and wolf-skin boots. But as we approached, their faces suddenly broke into broad smiles. We hugged each other, laughed, and joked.

We were then driven in an open-top jeep to the town of Leninsk, followed by a motorcade that stretched for several kilometers. A government committee was awaiting our arrival, ready with many questions about our 26-hour spaceflight. We had to deliver reports on how our mission had gone. Mine was brief and to the point: “Provided with a special suit, man can survive and work in open space. Thank you for your attention.”