Councils and health boards must stop playing their costly "game of ping pong" with sick people and work together, Deputy First Minister John Swinney has demanded.

The successful integration of health and social care could cost taxpayers about a tenth of the current spending on often competing budgets, he told Holyrood's Local Government Committee.

Kevin Keenan, finance spokesman at council umbrella body Cosla, has called on doctors to engage in more "social prescribing" - paying for patients to attend council gyms for restorative exercise.

Mr Swinney has also called on council pension fund managers to invest more in public infrastructure - but Mr Keenan said fund managers are finding it very difficult to disinvest from lucrative quick fixes such as tobacco.

On the current conflict between health and social care budgets, Mr Swinney said the public has "no interest in understanding the debate that goes on within local authorities over who is paying for who".

"It becomes quite frustrating when there is a bit of a debate going on between public authorities - which actually consumes resources," he said.

"Valuable resources that could be deployed in caring for vulnerable individuals is spent on a game of ping-pong over who is going to pay for the care whereas it is patently obvious the individual needs that support.

"Adult health and social care integration must lance that and lance it ferociously."

He added: "The balance between acute care, primary care and social care are the meat and drink of the sustainability of public services.

"We all know it costs disproportionately more to support an individual in an acute hospital than it does to support somebody in their own home - probably about ten times the amount.

"As finance minister, I can see the merits of an option which costs one-tenth the money."

Mr Keenan said: "We have got to look at ways to introduce, at an early stage, some kind of mechanism that stops people falling into ill health.

"I would like to see, personally from a local community planning partnership, more social prescribing where doctors use our sports facilities and local government to make sure people take light exercise.

"We have coaches that would be good to reduce blood pressure and heart disease."

Mr Swinney said councils' reluctance to invest in public infrastructure is another personal frustration, citing the M80 upgrade between Stepps and Haggs, where he had to obtain £320 million funding from the markets rather than local cash.

"I would have thought that was the type of project that was ripe for local authority pension funds to support because it was a main arterial route in Scotland," he said.

"It was a fundamental part of the infrastructure of Scotland so the Scottish Government would have to make repayments over the years from it - a totally secure, safe, totally robust long-term investment."

Mr Keenan, a Dundee councillor, said the Scottish Government must put up an incentive for pension fund managers to invest.

"Obviously it would be about the incentive, how quick would they get their cash back out because they might not want to invest in a property for the long-term," he said.

"From a fiduciary duty point of view, it would be our wish to disinvest from tobacco, but it delivers a lot of money and it is something that we are finding it very difficult to do."