Apple has finally been granted permission to build its €850M ($1B) European data center in Ireland, more than two-and-a-half years after it was first announced. The decision was made by Ireland’s High Court this morning, after a lengthy planning battle.

The decision was so long delayed that Apple not only had time to complete construction of the Danish data center announced at the same time, but to announce a second one there – raising concerns that the company may have given up on Ireland …

It had initially looked like permission would be a formality, with Apple vowing to hide the center in forest land, fully restoring all the temporary damage done, and to power it entirely from renewable energy. It also appeared that the majority of the local population was in favor, given the jobs and income the center would bring to the area. Planning approval was quickly granted before objections were lodged on environmental grounds.

The planning body asked Apple to address five concerns. Apple did so, and an inspector submitted a favorable recommendation. All looked good when the company was granted the ‘final’ go-ahead last summer, until three residents filed a High Court appeal. That appeal was delayed not once but twice, leading some to lose hope that the project would ever proceed.

However, Business Insider reports that Ireland’s top court has now heard the case and ruled in Apple’s favor, allowing the project to go ahead.

The Irish and Danish data centers are designed to improve the performance of cloud services for European customers, including Siri, iMessage, iTunes, iMessage and Maps.