Cash-strapped Dudley Council will have to pay £40,000 to buy back land that was subject to a controversial decade-long battle over a proposed mosque.
The authority will have to hand over the sum to the Dudley Muslim Association in order to regain ownership of the site in Hall Street which was disputed for so long.
Bosses hope the money will then be recouped by selling the land once it is back in their hands.
The saga over the plans to build the mosque appeared to finally have been brought to an end last month when appeal judges ruled in favour of the council's bid to seize back the land.
The amount owed by the council would have been much higher but the DMA was ordered to contribute £114,000 towards the council's legal costs following the hearing.
Dudley Council is currently trying to find £20 million worth of savings over the next three years.
Finances bosses said the £40,000 bill would be met from its capital budget.
They expect to have the land back in its ownership in January and said they anticipate their being some 'site issues' to address before the site is put on the market.
A report by the council's chief executive, Sarah Norman, and council strategic director, Philip Tart, said: "The DMA was ordered to pay a contribution to the council’s legal costs amounting to £114,451.30 and the Hall Street land has to be transferred to the council by 22nd January, 2016.
"At the same time, the council has to pay to the DMA the purchase price of approximately £155,000.
"Therefore, the net sum payable by the council to the DMA will be approximately £40,000.
"As the council has now received the Order from the Court and expects to have the land transferred in January 2016, there will be some immediate site issues that the council will need to address.
"This will then be followed by bringing the site to the market in due course."
In total, the authority spent more than £200,000 on legal costs battling the mosque bid, which proved to be hugely controversial in the town.
More than 80,000 people signed petitions against plans for the mosque, which would replace Dudley Central Mosque in Castle Hill.
The controversy has sparked five far right protests in five years, including the recent march by 200 protestors last weekend and previously by the English Defence League.
The cash payment will be discussed by Dudley Council's cabinet at a meeting'