YOSEMITE NATIONAL PARK, Calif. — A world-renowned speed climber was rescued from Yosemite National Park's El Capitan by helicopter Friday after spending a chilly night on top of the famous rock when he fell and injured both legs.

Rescuers reached Hans Florine and his climbing companions by helicopter Friday morning because it was too late and too dark to do so Thursday evening, Yosemite spokesman Scott Gediman said.

Florine, 53, and partner Alex Honnold set a speed-climbing record in 2012 for ascending the vertical Nose route of El Capitan in two hours and 23 minutes. The record was beaten in 2017.

Honnold said on social media that Florine "injured both legs" but has been in good spirits.

"Hans taught me much of what I know about the Nose, and about speed climbing in general, and the idea of him being in so much pain on his most beloved route really saddens me," Honnold wrote on Instagram.

Honnold told AP both legs were injured, but he did not know the extent of the damage.

Florine posted a photo of himself on Instagram Thursday with the caption: "Well, there is a rescue going on, on El Capitan. And it's me. I think I broke my leg. Rescuers please be safe."

El Capitan rises 3,000 feet (900 meters) from Yosemite Valley.

Rescuers lifted Florine to the summit on Thursday since he was closer to the peak than the bottom, Gediman said. Florine was given medical treatment and bunked down in weather in the mid-40s.

Gediman said he did not know how far Florine fell.