Scotland could become a "world leader in ending homelessness" under a new plan to end rough sleeping, charities have said.

The Scottish Government said it will shift towards getting homeless people into long-term and settled accommodation as part of their Ending Homelessness Together Action Plan.

Described as a "historic opportunity to make a real difference", it aims to not only rehouse those on the streets quickly but to prioritise prevention of homelessness in the first place.

The plan was launched by communities secretary Aileen Campbell at visit to homelessness charity Cyrenians in Edinburgh.

Ms Campbell said: "Everyone needs a safe, warm place to call home. It's more than a place to live it's where we feel secure, have roots and a sense of belonging.

"The causes of homelessness can be complex and that's why all services need to be joined up. Working together we can end homelessness for good."

The plan includes a £3bn commitment to build 35,000 homes for social rent across Scotland and a "multi-million pound" fund to help rough sleepers get off the streets for good.

Jon Sparkes, chief executive of the Crisis charity, said the plan positioned Scotland as a "world leader" in ending homelessness.

"The plan has people at its heart and makes clear that the best approach is to prevent homelessness in the first place," he said.

"However, we need to see a prevention duty in law for all public bodies as well as an ambitious set of targets which demonstrates that homelessness has been ended for more people.

"Overall this plan presents us with a chance to get behind bold and transformative reforms, and see Scotland lead the way once again.

"It is a unique opportunity to get policies and services right for homeless people, but also to look beyond homelessness into the wider systemic issues of inequality and poverty to bring an end to the injustice of homelessness in Scotland once and for all."

Gavin Yates, chief executive of Homeless Action Scotland, welcomed the report as "a useful tool to help judge progress" but warned long-term funding commitments were required to "remove the stain of homelessness from Scottish society".

Mr Yates added: "The key to change is to ensure that all the participants in making change, work together. "The Government, local authorities, housing associations and NHS and health and social care partnerships need proper joined-up planning and crucially need to work hand in glove with voluntary sector partners to make the change needed on the ground."

Scottish Greens co-convener Patrick Harvie MSP said the plan must be accompanied by legal reforms if it is to have any real success.

He said: "We must ensure that homelessness is prevented in the first place and this cannot be achieved by relying on the good work of councils and charities.

"Scottish ministers must review current inadequate laws, such as the Private Housing (Tenancies) Act, which still allows for the eviction of tenants on eighteen statutory grounds including when they have done absolutely nothing wrong, and should not find themselves losing their homes.

"Until then the new action plan cannot be realised if people continue to be threatened and forced into homelessness."