Cisco and Arista issued a joint statement today saying they have come to an agreement that resolves their existing litigation. And as part of their agreement, Arista will pay Cisco $400 million.

The two companies have been battling in court since December 2014. Their legal fight spawned two District Court cases and two International Trade Commission investigations. Cisco had argued that Arista’s products infringed on Cisco patents and copyrights related to its Command Line Interface (CLI).

Arista argued in its defense that Cisco’s CLI was so widely used that it had become an industry standard. Arista also argued that Cisco didn’t file lawsuits against other companies that used its CLI. Arista claimed that Cisco’s motives were based on the competitive threat from Arista.

The drama between the two companies also included a personal element. Arista CEO Jayshree Ullal is a former Cisco executive who was once close to former Cisco CEO John Chambers. But the two ultimately became public enemies.

In today’s agreement the companies said that, with limited exceptions, they will not bring any new litigation over patents or copyrights related to their existing products for five years. Arista also committed to maintaining the product modifications it has made as a result of previous rulings, and it will be making limited changes to further differentiate its user interfaces from Cisco’s.

Arista’s stock is trading up 5.35 percent this afternoon, and Cisco’s stock is up 1.10 percent.

For some perspective on the $400 million settlement price — Arista last week reported its financial results for its second quarter ended June 30. Its revenues for the quarter were $519.8 million, an increase of 28.3 percent year over year. And Ullal said the quarter was a record one for Arista, and the company has achieved $2 billion in annual run rate revenue.