Only one of three Spanish cavers trapped at the bottom of a deep ravine in Morocco's High Atlas mountains was extracted alive on Sunday after a complicated rescue operation, officials said.
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 the first Spaniard -- identified as Gustavo Virues -- had died as rescue workers scrambled to reach the trio at the bottom of a 400-metre-deep (1,320-foot) ravine in an area where access is difficult.
Officials in Ouarzazate, southern Morocco, had said the other two men were "injured" and had received first aid ahead of their planned evacuation.
But the Spanish interior ministry late on Sunday announced 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.
He had broken his legs and suffered a head injury, his wife told Spanish public television.
Twenty-seven-year-old policeman Juan Bolivar is the sole survivor of the ordeal.
He has been extracted from the ravine and was on his way to a hospital in Ouarzazate, Spanish interior ministry sources told public television.
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 search teams in the commune of Tarmest but heavy fog on Saturday hindered the rescue operation, officials said, adding that the trio had not been accompanied by professional guides.
The area the cavers were exploring is rugged terrain which includes peaks of around 4,000 metres still covered with snow from winter.
Experts have said a rise in temperatures in recent days could have caused a flash flood that trapped the cavers.
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.
Track Latest News Live on NDTV.com and get news updates from India and around the world