The Trump Organization and celebrity chef José Andrés settled a nearly two-year legal battle that began when the chef backed out of opening a restaurant at Trump International Hotel after President Trump’s controversial remarks about immigration in June 2015.

The two parties have not disclosed the terms of the settlement.

Mr. Trump sued Andrés for $10 million in 2015, and Andrés, a Spanish immigrant, countersued for $8 million, claiming Mr. Trump’s remarks made it difficult to attract Hispanic staff or customers. Andrés offered to settle that suit in February.

Get Breaking News Delivered to Your Inbox

“I am glad that we are able to put this matter behind us and move forward as friends,” Donald Trump, Jr., said in joint news release with the chef’s firm, ThinkFoodGroup. “Since opening in September 2016, Trump International Hotel, Washington, D.C. has been an incredible success and our entire team has great respect for the accomplishments of both José and TFG. Without question, this is a ‘win-win’ for both of our companies.”

Andrés, in the statement, said he was “pleased that we were able to resolve our differences and move forward cooperatively, as friends.”

The dispute began after Mr. Trump said referred to some Mexican immigrants as criminals and rapists during his June 2015 presidential announcement. Andrés backed out of his lease to open a restaurant, prompting Mr. Trump to respond with a lawsuit. Mr. Trump, after his election, was deposed in the lawsuit and answered questions under oath.

Mr. Trump has been involved in at least 3,500 legal actions over the last 30 years, according to a USA Today analysis. On his first Monday in office, Mr. Trump was sued by ethics lawyers for the previous two presidents who claimed he already had constitutional ethics violations involving his businesses.