After releasing four studio albums for Warner Bros. Records since 2005, California rockers Avenged Sevenfold are trying to get out of their as-yet-unfulfilled recording contract, citing the state’s famous "seven-year rule.”

In turn, the label has filed a breach-of-contract suit against the hard rock act, seeking compensatory damages.

The “seven-year rule” of the California Labor Code allows parties to leave personal service contracts under certain circumstances after seven years have passed. Upon record industry lobbying, the 70-year-old law was amended in the 1980s to allow record companies to claim lost profits on uncompleted albums. Record companies, though, only have 45 days to do so when an artist exercises the right to terminate.

“Avenged Sevenfold recently exercised the rights given them by this law and ended its recording agreement with Warner Bros. Records,” the band’s attorney Howard E. King said in a statement. Since the 2004 contract was signed, King says the label “underwent multiple regime changes that led to dramatic turnover at every level of the company, to the point where no one on the current A&R staff has even a nodding relationship with the band.”

Avenged Sevenfold Earns Second No. 1 Album on Billboard 200

In its lawsuit (dated Jan. 8, 2016), Warner Bros. claims Avenged Sevenfold’s decision to utilize the “seven-year rule” was unlawful for several reasons. The label says the band sent it a letter announcing an intent to leave the contract effective Nov. 25, 2015, but Warners did not receive it until Nov. 30. And even if such notice properly met a so-called “future date certain” requirement, Warner Bros. claims it has invested significant funds in the band’s future releases and has allegedly been led on to believe the agreement would remain effective, thus making the sudden opt-out unfair and a breach of good faith and fair dealing. Furthermore, the lawsuit reveals that the band is obligated to turn in an additional CD/DVD live album, which the label purportedly already funded.

Avenged Sevenfold’s original contract called for just five studio albums (of which they’d completed four), though the lawsuit states than an attempt to renegotiate the contract was made in fall 2015 to include a sixth album, albeit unsuccessfully.

10 Rock Bands That Sell Much More Than You Think

Warner Bros. has demanded a trial, where it will seek to rule out the band’s attempt to escape its contract via the “seven-year rule” and, in addition to the aforementioned damages, it is seeking “restitution and disgorgement of all gains and benefits” Avenged Sevenfold has received, pre- and post-judgment interest, attorneys’ fees and other relief deemed necessary.

"The band looks forward to building a relationship with a new label," King says. "[Avenged Sevenfold] has every expectation that it will forge the success and personal relationships with them that it once had with Warner Bros.”

Each of their last two studio albums -- 2013's Hail to the King and 2010's Nightmare -- has debuted atop the Billboard 200. Each of their last five has sold over 500,000 copies, with 2005's City of Evil leading the charge at over a million.

Rita Ora recently cited the “seven-year rule” in an attempt to leave a contract with Roc Nation. For more information on the law’s history and conditions, consult The Hollywood Reporter’s recent story.