The remains of a bear believed to be up to 40,000 years old have been recovered from Scotland's longest cave.

The animal's skeleton was brought to the surface after a 12-year operation to unblock an entrance to where it lay.

It was found in 1995 by cave divers exploring the two mile-long stream cave Uamh an Claonaite in the network of caves at Assynt in Sutherland.

It took the cavers from the Grampian Speleological Group until the end of last year to unblock an old 100ft-deep entrance shaft and provide a dry way into the cave.

The group removed the skeleton at the end of June using cases to protect the bones as they were carried through narrow passageways to the surface.

The caves are designated as a national monument and a site of special scientific interest. Scottish Natural Heritage (SNH) and Historic Scotland (HS) had to give their permission for the work to take place.

SNH said it is the first time such a complete bear skeleton has been found in Scotland, and it is also rare for the UK.

Lesley Cranna, SNH's North Highland area manager, said the discovery will help fill in gaps in history.

She said: "The bones will shortly be analysed and this sort of information helps us to build up a picture of the environment at the end of the last Ice Age.

"It's exciting to think that today in the 21st century we can piece together tiny fragments of events which took place many thousands of years ago."

It is thought the bear was washed into the cave at the end of the last Ice Age, making it at least 11,000 years old.

Animal remains in nearby caves date to more than 40,000 years ago, so the bear bones could be of similar age.

Bears were hunted to extinction in Scotland about 1,000 years ago.

The cavers recovered everything visible of the bear, which was 70-80% of the remains, including the skull, backbone, ribs, and most of the animal's long bones.

They have been passed to National Museums Scotland, the national museum service, which will "stabilise" the bones and radiocarbon date them to establish when the bear died and if the skeleton is that of a brown bear or a polar bear.

Ivan Young, Grampian Speleological Group treasurer, said it was satisfying to finally recover the skeleton.

He said: "Having looked forward to it for so long, it was quite rewarding to get the bones out and get them over to the people at the museum because I think they are quite excited about getting a complete skeleton.

"When we went to the cave in 1995 we were not expecting anything.

"We've been in lots of other caves where you may find the odd rabbit bone but to find such a large collection of bones close together was quite unique."