A religious group building a massive Noah’s Ark tourist attraction in Kentucky has won a legal battle over the state’s withdrawal of a potential tax incentive worth millions.

A federal judge ruled Monday that Kentucky officials violated the ark builders’ First Amendment protections by blocking it from the sales tax tourism incentive that could have been worth up to $18 million.

The Ark Encounter, being built by Christian group Answers in Genesis, is due to open in July.

U.S. District Judge Gregory Van Tatenhove ruled the state’s Tourism Cabinet cannot exclude the ark attraction from the incentive based on its “religious purpose and message.” The state initially celebrated the project but reversed course in late 2014.

Answers in Genesis founder Ken Ham called the ruling a “victory for the free exercise of religion in this country.”