The state Supreme Court has ruled in a four-year legal battle between Sweetwater Brewing Co. and AlaBev over whether or not the brewer can leave its distributor.

In 2012, the Atlanta brewer notified AlaBev (then called Birmingham Beverage Company) of its intent to switch to Supreme Beverage. AlaBev sued Sweetwater for breach of contract and alleged that the brewer did not follow the process laid out in Alabama law to switch distributors.

Under Alabama law, brewers and wholesalers can't decide exit conditions for their own contracts. In the three-tier system, brewers sell to wholesalers, who sell to retailers, who sell to the general public.

Judge Donald Blankenship granted a summary judgment in favor of SweetWater and Supreme on July 7, 2015. AlaBev's attorneys appealed the case to the Alabama Supreme Court, and the court affirmed Blankenship's decision Friday. The court did not issue a written opinion with the decision.

Under Alabama law, a beer producer can only have one wholesaler for a given territory, usually counties. The law requires a producer and a wholesaler have a territorial agreement in writing and on file with the state Alcohol Beverage Control Board.

Blankenship cited in his 2015 ruling that there's no evidence that a written territorial agreement between SweetWater and AlaBev ever existed or was on file with the ABC Board in his ruling for SweetWater.

"There is no evidence that this reduction was part of any agreement between SweetWater and Supreme," Blankenship wrote in the order. "Further, without a valid territorial agreement, BBC has no basis for asserting any illegality in this action."

SweetWater was the 18th largest craft brewer in the nation in 2015, according to Brewers Association.