Katy Perry won a major real estate battle on Wednesday, with a Los Angeles judge ruling that the singer will get the chance to buy a former Loz Feliz convent.

The hilltop convent is highly coveted real estate, with Perry offering $14.5 million for the property. Two nuns who used to live there, however, tried to sell the property to entrepreneur Dana Hollister.

A local Catholic archbishop argued that the nuns did not own the property, and he tried to sell it to Perry. Los Angeles County Superior Court Judge Stephanie Bowick saw it his way, ruling on Wednesday that the nuns’ attempts to sell the building were improper.

She also ruled that Los Angeles’ archbishop has to authorize any sale of the property, and that the nuns did not clear the sale with him first.

Bowick’s ruling rescinds Hollister’s deed on the property. Hollister had planned to turn that building into a boutique hotel, which drew concerns from some neighbors.

Hollister had already begun to renovate the ex-convent, but was sued by the archdiocese last year, sparking the litigation involving Hollister, the nuns and Perry. Perry met with the nuns in May 2014 to see if an agreement could be worked out. Two of the nuns, however, left the meeting unconvinced.

While Perry has the approval of the archbishop, her bid will also have to be approved by the Vatican to complete the sale.