Samsung agreed to pay Apple $548 million to settle a smartphone patent dispute, but the payment won’t put an end to the long-running legal battles between the two companies.

In a joint statement filed to the United States District Court for the Northern District of California on Thursday, the two companies said that Samsung had agreed to make the payment in accordance with a partial judgment in Apple’s favor handed down in September.

But Samsung also said in the statement that it wants to be able to get all or some of that money back if “the partial judgment is reversed, modified, vacated or set aside on appeal.” Samsung also raised the possibility that it might take the case to the Supreme Court, writing that it would ask for reimbursement if the partial judgment changed as a result of any petition filed with the Supreme Court.

“We are disappointed that the court has agreed to proceed with Apple’s grossly exaggerated damages claims regardless of whether the patents are valid,” Samsung said in an emailed statement. “While we’ve agreed to pay Apple, we remain confident that our products do not infringe on Apple’s design patents, and we will continue to take all appropriate measures within the legal system to protect our products and our intellectual property.”

In a filing to the court, Apple disputed Samsung’s assertion that it had any right to be reimbursed. Apple reiterated in a statement that the ruling “reinforces what courts around the world have already found: that Samsung willfully stole our ideas and copied our products.” The company also thanked the court for “sending a loud and clear message that stealing isn’t right.”

The payment stems from one of two outstanding lawsuits between Apple and Samsung, which are fierce rivals in the smartphone market. This case began in 2011 when Apple sued Samsung for $2.5 billion in damages for infringing on some technology and packaging patents for devices.

Apple won in 2012, but was awarded only about $1 billion. After years of appeals, some parts of the case have been dismissed by the court. Samsung is now paying $548 million to settle the technology patent allegations.