BIARRITZ, France — U.K. Prime Minister Boris Johnson won the sympathy of U.S. President Donald Trump on Monday after the American leader suggested that the European Union would drive a hard bargain and that it would be "tough" to get a Brexit deal.

Speaking at the end of the G-7 summit in France, Trump offered effusive praise for Johnson, who took power last month, and said that he had to "try to do something with Brexit," a task that eluded his predecessor Theresa May. May failed three times to get her deal through Parliament and then was toppled by her own party.

"The EU is very tough to make a deal with," Trump said. "Just ask Theresa May."

The comments came after a summit dominated by what Britain would do once it loses its primary trading partner when it leaves the European Union on Oct. 31. As he sought to position his nation for a post-Brexit universe, Johnson was at pains to say that he wouldn't just take any deal.

But he also refused to rule out suspending Parliament, saying it was up to lawmakers to carry out Brexit.

"I think this is really a matter for parliamentarians to get right," he said. "I think that people have just about had enough of this conversation. And I think they are yearning for a moment when Brexit comes off the front pages."

Johnson and Australian Prime Minister Scott Morrison agreed at the summit in the French resort town of Biarritz to do a trade deal after the United Kingdom leaves the EU. Morrison said he believed a U.K.-Australia pact could be done within a year.

"But at the end of the day it's got to be in our interests," Morrison said. "We are not going to sign up to something we don't think helps us and neither will they."

After a one-on-one meeting with Johnson at the three-day G-7 summit on Sunday, Trump promised they would work out "a very big trade deal" once Brexit happens.

Johnson also met Monday on the summit's sidelines with Egyptian President Abdel-Fattah el-Sissi. The two discussed their shared desire to strengthen economic, trade and security co-operation between the U.K. and Egypt.

Despite the optimistic outlook given for Britain's trade and future, the country's departure from the EU and its single market of 500 million hasn't taken place more than three years after voters backed leaving. Johnson said Sunday that the U.K. should prepare for an exit without a withdrawal deal in place, acknowledging that the prospect of a Brexit agreement getting approved in the next two months was "touch and go."

The prime minister's promise to bring his country out of the EU on Oct. 31 no matter what has raised worries about a disorderly divorce that would see new tariffs and border checks on trade between Britain and the EU, seriously disrupting business.

Johnson has told European Union officials it won't be possible to stop Britain's departure from the trading bloc without the removal of controversial language about a "backstop" to avoid the return of a border between EU member Ireland and Britain's Northern Ireland.

He said Monday that he was "marginally more optimistic."

"But, remember that all statistical estimates that I give about the chances of a deal - whether they are expressed in odds of millions to one, or getting closer, or hotter or colder, or whatever - they all depend exclusively on the willingness of our friends and partners to compromise on that crucial point and to get rid of the backstop and the current withdrawal agreement."

The consequences of a no-deal Brexit could be costly to the EU, Johnson suggested in interviews with broadcasters. He told Sky he would withhold the bulk of the 39 billion pounds ($48 billion) the U.K. is supposed to pay the EU for the divorce if there is no deal.

Johnson badly needs a trade deal with the United States and other big powers. Supporters of Brexit say a free trade deal with the U.S. could help make up for reduced commerce with the EU. In 2018, Britain did almost half its trade with the EU, while the U.S. accounted for 18% of U.K. exports and 11% of imports.