Juan Bolivar, a 27-year-old policeman and the only man to leave the ordeal alive, was admitted to the private Chifa clinic in Ouarzazate, southern Morocco, on Sunday night, according to an AFP photographer.
With eyes closed and bandages on his legs, Bolivar was transported from the scene by police and taken into the clinic on a stretcher.
All three potholers were initially found alive on Saturday morning, several days after they had gone missing after breaking off from a group of nine Spaniards to explore different caves.
But officials said late Saturday that one man -- 41-year-old Gustavo Virues -- had died as rescue workers scrambled to reach the trio at the bottom of the 400-metre-deep (1,320-foot) ravine in an area where access is difficult and a helicopter cannot land.
Officials in Ouarzazate had said the other two men were "injured" and had received first aid ahead of their planned evacuation.
However the Spanish interior ministry announced late on Sunday that Jose Antonio Martinez, 41, had also died while awaiting rescue.
"My condolences to the family and friends of Jose Antonio Martinez, a chief police inspector who died in Morocco," the ministry said in a message on Twitter signed by Interior Minister Jorge Fernandez Diaz.
Mi sentido pésame a la familia y compañeros de José Antonio Martínez, inspector jefe de @policia fallecido en Marruecos. Fdo.Jorge Fdez Díaz— Ministerio Interior (@interiorgob) April 5, 2015
Martinez had broken his legs and suffered a head injury, his wife told Spanish public television station TVE.
TVE, quoting Moroccan rescue workers, said one of the three had possibly slipped on a patch of ice, dragging the other two down with him as he fell.
Fellow cavers raised the alarm on Tuesday after the trio failed to show up in Ouarzazate as planned after splitting from the group on Sunday.
The three were located by Moroccan search teams in the commune of Tarmest, but heavy fog on Saturday hindered the rescue operation, officials said, adding that the men had not been accompanied by professional guides.
But Virues's cousin Victor Rengel told TVE that the deceased lawyer and father-of-two was an "experienced" caver who had even taken part in rescue operations.
The area the adventurists were exploring is rugged terrain which includes peaks of around 4,000 metres still covered with snow from winter.
Ouarzazate lies to the south of the High Atlas range on the edge of the Sahara desert, about 510 kilometres (320 miles) by road from the capital Rabat.