A redundant church building is on course to become Scotland's first urban community buy-out.

A campaign to take over the former Portobello Old Parish Church in Edinburgh was launched after the building closed two years ago.

The closure followed the congregation's merger with two other nearby churches to form Portobello and Joppa Parish Church.

Read more: Scots abroad face huge health bills after Brexit

The Church of Scotland refused the campaign's plea to delay putting it on the market to allow them more time to raise funds for the buy-out.

But now the Scottish Government has accepted the application for a community right to buy and has asked the Kirk to put the sale of the church and halls on hold pending a decision.

The campaign needed to show it had the support of ten per cent of the local population to take forward the proposed buy-out.

But the campaign secured 1500 signatures - 25 per cent of the people in the area around the church.

Justin Kenrick, of the Friends of Bellfield, said: "We are delighted to have secured the first ever successful urban community right to buy registration.

"We are hopeful that the Church of Scotland will see this as a win-win outcome, so that we can move forward in a collaborative spirit to ensure the best possible outcome for Portobello and Joppa Parish Church as well as for the community as a whole.

Read more: Scots abroad face huge health bills after Brexit

"We believe that, although nothing is assured, we have every reason to be optimistic as we continue to do everything we can to try to save this vital resource for the community."

A team of independent consultants led by Urban Animation is drawing up detailed proposals on how the building can be used and will work with the campaign on a business case.

The campaign needs to show its plans meet community needs and are financially sustainable.

If the buy-out is approved by the government, Action Porty, the company set up by the campaign to take forward the purchase will then have to raise enough money to pay the market value for the building, which has been estimated at around £600,000.

Mr Kenrick said it was hoped that up to 80 per cent of the finance could come from the government's Scottish Land Fund, which previously gave £16,000 for a feasibility study.

The Friends of Bellfield say they want the church halls to continue as a base for groups like the Scouts and Guides and also a "no music" cafe run for older people.

The church sanctuary could become a space open to people of all faiths and none to celebrate lifetime landmarks like marriages, deaths and naming ceremonies for children.

Read more: Scots abroad face huge health bills after Brexit

The secretary of the Church of Scotland's General Trustees, David Robertson, said the government's decision to accept registration of the buy-out would be discussed at a meeting this week.

He added: "We have known for some time this was likely to happen.

"This is the first case we have dealt with following the extension of the Scottish Land Fund into urban areas.

"As a registered charity we are obliged to achieve proper value for our assets and we await with interest to see how this process develops."