Media playback is unsupported on your device Media caption John Beattie meets Robbie Renwick and Michael Jamieson

An overwhelming majority of Scotland's publicly-funded elite athletes are drawn from middle class backgrounds, a BBC Scotland investigation has found.

It discovered that almost nine in 10 went to either fee-paying schools or a state school in a wealthy area.

The data was uncovered by The Medal Myth, a documentary looking at elite sport, health and public spending.

Sport Scotland said it was trying to do more to increase opportunities for all on its elite programmes.

BBC Scotland originally asked Sport Scotland for demographic information about the athletes it supports - a total of more than 500.

However, the agency said it did not have any data, so the programme team used search engines to try to determine which schools athletes attended.

Where data could be found, it showed the vast majority of athletes went to schools that were private or served relatively wealthy communities.

Image copyright Thinkstock

Researching the backgrounds of Scotland's elite athletes

BBC Scotland used search engines to try and determine where athletes went to school.

We found information for 383 of 525 athletes (72.9%).

We looked at state schools ranked by free school meal entitlement. We divided those into bands - for example, the top 20% are the schools with the lowest free school meal entitlement, and therefore serve wealthier children.

The results do not reveal the detailed background of athletes themselves, but they do give a broad indication of whether the athlete group broadly represents wider society.

Reacting to the research, Prof Leigh Robinson of Stirling University - an expert in sport policy - said: "I think anything that comes from the public purse should have generally wide public merit good and I'm not convinced that elite sport does that.

"I'm not entirely sure that elite sport is something that's accessible to the public in general or indeed leads to benefits that are available to the public in general."

Media playback is unsupported on your device Media caption Sport Scotland seek more opportunities for athletes

Sport Scotland's chief executive Stewart Harris said the agency was trying to improve the situation.

He said: "We're working to get more opportunities. We're working to try and get in every sport a pathway which goes from school to community to performance, if they have the talent and ambition, if they want to go there.

"I think actually the spend and the resource is actually in a pretty good place right now.

"95% of the sport budget in Scotland is spent on school and community, 5% is spent on performance.

"So I think the balance of it, if you take the system, then I think... as a society in Scotland with the resources we have available, we're in a good place with that."

The organisation is in the middle of a four-year funding cycle that will see it spend over £45m on its performance programme.

Recent Olympics and Commonwealth Games have seen record numbers of medals for Scottish athletes.

The Medal Myth will be broadcast on BBC One Scotland on Monday 2 January at 20:30. It will be available afterwards on BBC iPlayer.