President Donald Trump on Thursday told reporters that he would be willing to act as a mediator in an effort to foster peace between Qatar and other Arab countries which have accused it of supporting terrorism and destabilizing the region.

The crisis erupted on June 5, when Bahrain, Egypt, Saudi Arabia and the UAE all severed diplomatic and transport links with Qatar over the country’s funding of extremists and ties with Iran. Qatar hosts a US military base critical to the effort to defeat ISIS in Iraq and Syria and is the world leader in liquefied natural gas exports.Qatar has long denied the accusations that they fund extremists. The alliance contends that Qatar has destabilized the region by supporting proxies of Shiite-dominant Iran and Sunni extremists. Qatar denies the charges.

In his comments, President Trump offered a pointed reminder that terrorism financing is at the heart of the crisis. At one point he said that the dispute “began because of that fact that there has been massive funding of terrorism by certain countries.” He did not identify those countries, but in June he had made reference to complaints about Qatar.

“While I do appreciate and respect the mediation, I would be willing to be the mediator,” Trump told reporters on Thursday at a joint news conference alongside the emir of Kuwait. “I was telling the emir before that if I can help between UAE and Saudi Arabia … if I can help mediate between Qatar and, in particular, the UAE and Saudi Arabia, I would be willing to do so.”

The President noted that he spoke to King Salman of Saudi Arabia via phone on Wednesday, describing their relationship as “very great” and calling him “a friend of mine.” And he suggested he could help strike a quick deal.

“I think you’d have a deal worked out very quickly. I think it’s something that’s going to get solved fairly easily,” Trump said. “Kuwait has been really the leader of getting it solved, and we appreciate that very much. But I do believe that we’ll solve it. If we don’t solve it, I will be a mediator right here in the White House. We’ll come together very quickly. I think we’ll have something solved.”

The US and Qatar signed a “memorandum of understanding” deal in July, in an effort to fight terrorism in a country that has been accused of funding various terrorist operations. A senior adviser to Secretary of State Rex Tillerson said the agreement would help Qatar to “fortify its fight against terrorism and actively address terrorism funding issues.”

Tillerson announced the agreement in a joint press conference with Qatari Foreign Minister Sheikh Mohammed al-Thani, as part of his dispute settlement campaign in the Middle East in July.

The U.S. is allied with both sides. The regional headquarters for the U.S. Central Command is located in Qatar, including a state-of-the-art air base utilized by the Pentagon to target ISIS. Saudi Arabia is the top buyer of American weapons and has strong counter-terrorism ties with the U.S.

In his call with Salman last week, Trump “urged all parties to the Qatar dispute [to] find a diplomatic resolution.”

The emir said he believed that it was possible for a peaceful resolution to the crisis to be reached. He noted that Qatar had been presented with a list of 13 demands by the other countries and was willing to discuss them. Although Qatar has rejected some of them out of hand, Al Sabah said that he was of the opinion that negotiations were possible.

“I am optimistic that the solution will come in the very near future,” he said. “The hope has not ended yet.”

Demands rejected by Qatar include scaling back with Iran—Saudi Arabia’s main rival in the region, severing ties with the Muslim Brotherhood and shutting down the Al Jazeera media network that has provoked governments throughout the Middle East.

The president on Thursday also talked about striking a peace deal in the Middle East between the Israelis and Palestinians.

“They say it is the world’s most complex and difficult deal. You know that,” Trump told reporters. “But it is something that could happen. I believe that the relationships that we have with both can help. It’s an event that’s just never taken place.”

Trump acknowledged that peace might come “a little bit reluctantly” but pledged that the U.S. would give its best shot.

“Sometimes people think they’re close and it never happens, or it never happens successfully,” Trump said. “I think we have a chance of doing it. I think the Palestinians would like to see it happen, I think the Israelis would like to see it happen, and usually when you have two groups that would like to see something happen, good things can happen. So I think there is a chance that there could be peace.”

Trump dismissed the notion that Syrian leader Bashar Assad would use chemical weapons on his people again after the U.S. launched punitive airstrikes. He said that the U.S. “would be extremely upset” if Assad did use chemical weapons again, “but nothing would change.”

“As far as Syria’s concerned, we have very little to do with Syria other than killing ISIS. What we do is we kill ISIS,” Trump said. “And we have succeeded in that respect. We have done better in eight months of my presidency than the previous eight years against ISIS. So, ISIS is rapidly disappearing, as you know, and that’s because of our great military.”