* Britain due to leave EU in 68 days
* PM Johnson: EU tends to do deals at last moment
* Says British people and EU both want Brexit done
* Says marginally more optimistic on chances of a deal
* Trump: Brexit will probably work out but EU tough on deals (Adds quotes, details)
By William James
BIARRITZ, France, Aug 26 (Reuters) - British Prime Minister Boris Johnson said he was prepared to take Brexit talks with the European Union down to the very last minute before the Oct. 31 exit deadline, and if necessary to take a decision to leave without a deal on that day.
Johnson has 68 days to convince the EU to give him a new Brexit deal, with neither side so far willing to compromise on the most contentious issues. If he can't get a deal, he says Britain will leave the bloc anyway.
That leaves Britain, with the world's fifth largest economy, heading for a messy divorce with the EU that critics fear could lead to food shortages and major border disruption in the short term and undermine the country's prosperity in the long term.
When asked by Reuters if he was prepared to take talks with the EU right up to Oct. 31, Johnson said: "Well I do think that the EU does tend to come to an agreement right at the end."
"Clearly for us, the walking away, as it were, would come on October 31 when we would take steps to come out on the terms for which we will have by then made absolutely colossal and extensive and fantastic preparations," he told a news conference at the end of a G7 summit in the French resort of Biarritz.
The UK parliament has rejected three times a withdrawal deal reached by his predecessor Theresa May with the EU, prompting her resignation and deepening a three-year crisis that threatens Britain's status as one of the world's pre-eminent financial centres and a trusted, stable destination for foreign investors.
Johnson has come under criticism from lawmakers who want a no-deal Brexit stopped under any circumstances but on Monday sidestepped repeated questions from reporters on what he would do if parliament tried to delay or block a no-deal Brexit.
Johnson and his allies say that the bid to rule out no-deal undermines Britain's hand in negotiations with the EU. Earlier a British official said EU leaders should pay no heed to British lawmakers who say they can stop Brexit.
The prime minister declined to say if he would suspend parliament to force Brexit through, saying only that lawmakers had a duty to deliver Brexit.
He said that the British people were tired of Brexit being on the front pages of newspapers and that Brexit had to be implemented on Oct. 31, adding that allies saw Brexit as an old argument and an "encumbrance".
"I think that it's the job of everybody in parliament to get this thing done, I think it's what the people want. I also think by the way it's what our friends and partners on the other side of the Channel want," Johnson said.
"They want this thing done, they want it over."
Asked about talks with the EU, Johnson said he was "marginally more optimistic" about the chances of a deal but that the bloc would have to accept a "backstopectomy" - the removal of the Irish border insurance policy known as the Irish backstop which has proven the most contentious negotiating issue.
The chances of a deal "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," Johnson said.
U.S. President Donald Trump said at the summit that Johnson would be a "great" prime minister who could succeed where May had failed but that it would not be easy.
"They're going to be going at it for a little while, but ultimately probably it works out," Trump said of the Brexit negotiations.
"(Britain) may have to get out, they may not make a deal. The European Union is very tough to make deals with... just ask Theresa May." (Reporting by William James; writing by Alistair Smout and Guy Faulconbridge; editing by Gareth Jones)