The BBC's Laura Kuenssberg sat down for an interview with Prime Minister Boris Johnson after his meeting with the European Commission president Jean-Claude Juncker.
Here is the full transcript of what they said.
Laura Kuenssberg: You've just been with [European Commission president] Jean-Claude Juncker.
Do you feel you've made any progress since seeing him. I mean he could be the deal maker?
Boris Johnson: Yes. I mean obviously I've talked to him several times since becoming prime minister, but he's... I've known Jean-Claude for many, many years and he is a very, highly, highly intelligent guy and I think that he would like to get a deal if we possibly can, but clearly it's going to take some work.
We think that there are, we can satisfy the European Commission and our friends on the key points. Can we protect the single market the integrity the single market? Can we ensure there's no checks at the border in Northern Ireland? Can we protect all the achievements of the Good Friday Agreement and peace in Northern Ireland? Yes I think we can, while simultaneously allowing the whole of the UK to withdraw.
It will now take an accelerated timetable of work to, to get that done. And it maybe - you know - just have to say that it may be that we have to come out without an agreement if necessary on 31 October.
LK: And we will come to that in a second.
But just in the last few minutes, the [European] Commission has put a statement out, saying after your lunch that they still are yet to see proposals that they think are viable and workable.
So it doesn't feel like this is going anywhere at the moment?
BJ: Well, it's certainly the case that the Commission is still officially sticking on their position that the backstop has got to be there.
But clearly if they think that we can come up with alternatives, then I think they're on the mark.
I think the big picture is that the Commission would like to do a deal.
[Pause to adjust the microphone]
LK: I mean the Commission has immediately after your lunch put out a statement saying they still haven't seen viable workable proposals.
Do you feel they're listening or is this that they're saying something else behind closed doors to what they say publicly?
BJ: No, I think the Commission, I think Jean-Claude himself certainly would like to do a deal and would like the UK to, and would like to settle this if he possibly can.
They have their own constraints. They've got the European Parliament they've got to deal with. I think there's a deal there to be done and of the kind that I've described.
But clearly if we can't get movement from them on that crucial issue of whether the EU can continue to control the UK and our trade policy and our regulation - which is how it would work under the current Withdrawal Agreement - we won't be able to get that through the House of Commons, no way.
And we'll have an exit with no-deal on 31 October. That's not what I want. It's not what they want. And we're going to work very hard to avoid it. But, but that's the reality.
LK: But what is the broad shape of a deal that you think is there? I mean we've heard many times from you and ministers that there is a landing zone.
As simply as you can, what is the nature of the deal you think you can get?
BJ: I mean, I think that the important thing here is not to be... I mean, there is a negotiation going on, has been for a long time now about how to do this.
So there's a limit to how much the details benefit from publicity before we've actually done the deal. But the shape of it is, the shape it is...
LK: Slice and dice the backstop as it exists?
BJ: The shape of it is all about who decides.
Fundamentally, the problem with the backstop, as you remember, is that it's a device by which the EU can continue after we've left to control our trade laws, control our tariffs, control huge chunks of our regulation, and we have to keep accepting laws from Brussels long after we've left with no say on those laws.
Now that just doesn't work. It doesn't work for the whole of the UK and it doesn't work for Northern Ireland. So we have to find a way to avoid that situation.
LK: But what is that way? Because what you're saying there is just articulating the problem that's been articulated forever, about the backstop and people's concern that Northern Ireland would still have to and the rest of the UK would have to go along with EU rules.
But can you foresee a solution, for example, when in some areas, Northern Ireland would follow EU rules and the rest of the UK would not?
BJ: What we want to see is a solution where the decision is taken by the UK and clearly that's the problem with the, with the backstop. It basically leaves the decision making up to Brussels and that's no good.
LK: What's the actual solution that you're proposing? Is it giving more power to Stormont, for example, that's being talked about a lot, that the Northern Irish assembly might be given a lock on opting out or opting in on EU regulation?
BJ: These are certainly some of the ideas that are being talked about and as are the ideas that you're familiar with to do with maximum facilitations, to do with checks away from the border, all sorts of ways in which you can avoid a hard border in Northern Ireland.
This is all doable. It's all doable with energy and goodwill.
But I mentioned the other day when I was in in Dublin, you know the famous dictum attributed I think probably incorrectly to Ian Paisley the elder, [in] Northern Ireland the people are British, but the cattle are Irish, you know there's a there's a germ of an idea there.
LK: But it's just the germ of an idea...
BJ: There's a lot of thinking going on about how to get an agreement that gets the UK out whole and entire, but also protects that Northern Irish border, protects that peace process and protects all the gains that Ireland has got from its membership of the EU single market.
So, I'm, you know, I mean, more or less where I was the other day. I'm cautiously optimistic, cautious.
But it is vital that we're ready to come out on 31 October.
And of course what the... parliamentarians threatening to extend and all that kind of thing. They hear that they listened to that over here, but I didn't think it substantially changes their calculations.
LK: MPs though haven't just threatened to extend, MPs have changed the law to try to stop you taking the UK out without a deal at the end of October.
How do you propose to get round that? Because you keep saying you've got no intention of delay...
BJ: I won't. Here's, here's what I want. I will uphold the constitution, I will obey the law, but we will come out on 31 October.
LK: But how if MPs have changed the law to stop you doing that?
BJ: We're going to come out on 31 October and it's vital that people understand that the UK will not extend.
We won't go on remaining in the EU beyond October. What on earth is the point? Do you know how much it costs?
LK: But how will you do that if MPs have changed the law to stop you?
Are you looking for a way round the law? Because that's what it sounds like...
BJ: We will obey the law but we will come out - and - we will come out I should say on 31 October.
LK: But that means you are looking for a way round the law.
I mean, to be really clear about this, Parliament has changed the law to make it almost impossible to take us out of the EU without a deal at the end of October. But you say that you will not do it.
That means that you must be looking for a way around the law?
BJ: Well, you know those are your words. What we're going to do is come out on 31 October deal or no-deal. And staying in beyond 31 October completely... crackers.
You're spending £1bn a month for the privilege remaining in the... what is the point?
The people of this country want us to get on and leave the EU and deliver on the mandate of the people.
And staying in costs £250m a week, which is which is roughly the same as what it would cost to build a new hospital every week.
That's what Jeremy Corbyn and the opposition parties seem to think is a good idea. I don't think it's a good idea.
LK: You used to say it cost £350m a week, now you're saying £250m a week?
BJ: I think the priorities of the British people are to come out and that's what we're going to do.
LK: But do you really think that you want to be the kind of prime minister that is looking of ways of sneaking around the law to keep to your political promise?
I mean, everybody knows how strongly you feel...
BJ: These are all your words.
LK: But how will you do it then?
Will you challenge it in court? Will you take Parliament to court?
BJ: Our first priority, if I may say so, just to try and look on the bright side for a second or two, is to come out with a deal and that's what we're working to achieve. And I think we have every prospect of doing that.
LK: But if you don't, I mean you are looking, you know the law has been changed to try to make this impossible.
If you want to look for a way round it, many people believe that means you must be preparing somehow to ignore the law or to challenge that because it's a new area of law.
Would you seek to challenge the law in court? Will the government take Parliament to court?
BJ: What we're going to do is work very hard to get a deal that will allow us to come out.
I see no point whatever in staying on in the EU beyond 31 October and we're going to come out. And actually that is what our friends and partners in the EU would like too. And I think that they've had a bellyful of all this stuff.
You know they want to develop a new relationship with the UK. They're fed up with these endless negotiations, endless delays. They've now delayed twice before to achieve what is completely unclear to me.
LK: And you're completely clear that politically the promise you gave to your party was to leave on 31 October. And that was clear as crystal.
But since you've been in office you've suspended Parliament. You say you might find a way around the way that Parliament might change the law...
BJ: Well, that's what you've just said.
LK: Well, you haven't denied it prime minister. I mean it does seem since you've been in office that, some of the things that you have done, you seem to believe the conventions and rules somehow don't apply to you really?
BJ: Obviously I humbly, respectfully, disagree. If you're talking about having a Queen's Speech, I think that was the right thing to do. This Parliament has gone on for longer than any time since the Civil War.
It's right to have a Queen's Speech, it's right to set out our ambitious agenda for the country. There's all sorts of things we want to do. Whether it's investing in health care and putting police on the streets.
We've got a fantastic agenda for investing in science. A huge, huge agenda for this country. On the environment, on housing we have big, big projects.
We need a Queen's Speech. And by the way, all this mumbo jumbo about how Parliament is being deprived of the opportunity to scrutinise Brexit. What a load of claptrap.
Actually, Parliament I think has lost about four or five days. I don't think Parliament has sat during the period from late September beginning of October for about 120 years.
With great respect, I don't think people are aware of that fact. I think people think that we've somehow stopped Parliament from scrutinising Brexit. What absolute nonsense.
Parliament will be able to scrutinise the deal that I hope we will be able to do both before and after the European Council on 17 October.
LK: But when it comes to sticking to the promise you made to leave on 31 October...
BJ: We're going to do that.
LK: Is there a line that you would not cross?
BJ: Well yes, obviously I didn't want to go beyond 31 October. I think that would be a mistake.
LK: In order to stick to that goal, is there anything that you would not do?
Would you rule out suspending parliament again?
BJ: As I say, we're going to uphold the constitution and we're going to obey the law. And it's very important to realise that actually, I think our friends and partners in the EU are keen to work with us to get a deal.
That's what I've been doing here with Jean-Claude Juncker and Michel Barnier. We've been working very hard. We've had a good productive exchange.
Has there been a total breakthrough? I wouldn't say so. But I would say that a huge amount of work is now going to be done to sort it out.
Am I more optimistic than I was when I, when we took office? This morning? I would say a little bit, but not much, just a little bit.
Because I think that there's a, perhaps an even greater willingness on the part of the Commission to engage than I had, than I had thought.
So, so yes. I'm cautiously optimistic, but I'm not counting my chickens. And it is absolutely vital, it's absolutely vital for people to understand that the UK is ready to come out with no-deal if we have to.
LK: Do you feel that the UK is stable right now? I mean, it looks like chaos, doesn't it?
BJ: No, I think it's extremely stable. We've got unemployment at record lows. We have record levels of investment from overseas - one point £3tn pounds. There's no other country in Europe that gets these levels of investment.
If people genuinely thought, if people genuinely thought that there was some political risk in the UK, would they be investing in this in this country in the way that they are?
LK: Does it look politically stable?
BJ: This is an immensely, but it is an immensely stable country. We are going through what is, after all, a quite difficult exercise in democracy.
Which is, what happened is that the people of this country decided after 45 years of EU membership that that highly intricate relationship was one that they no longer wished to pursue. And that has had a great deal of consequence.
The disentangling of that relationship is obviously complex, but it can be done and it is being done. And we will get on with it successfully.
And I think people should be very optimistic about the future of this country, because it's a fantastic country. It is the leader and the cutting edge of most of the 21st century technology in Europe. And a place that attracts, not just huge quantities of inward investment, but the best and brightest from around the world.
And what we will, what we will ensure as we become, as we take advantage of Brexit, is that we remain not just open to our friends in the rest of the EU, but we reach out now to the rest of the world and take advantage of the opportunities the Brexit offers.
And I think actually what the people of our country want is a little less of this sort of gloom and kind of, you know, I think most people think that, honestly it's just nonsensical to think that democracy in the UK is any way endangered or the UK economy is in any way endangered.
We're going through a period of constitutional adjustment caused by the decision of the people to leave the EU. That was always going to be logistically and practically difficult to accomplish.
But we're going to do it and we're going it by 31 October, and we will be in very good shape whether we get a deal or not.
And if we don't get a deal, I'm still, as I say, cautiously optimistic that we will. If we don't get a deal, we will come out nonetheless
LK: One of the people who is extremely gloomy about what's happened is your old friend and rival and colleague David Cameron.
Now he says that the Leave campaign that you led lied.
He said that you behaved appallingly and he's a prime minister, a Tory prime minister, who left behind a total mess over Europe.
Are you worried you might face the same fate?
BJ: I have nothing but admiration. Look I don't want to say anything further about David Cameron and his memoirs than what I said the other day, which is I have the highest respect and affection, regard for him.
He and I worked together for many years and I think he has a legacy, in terms of turning around the economic chaos that Labour left, helping to introduce a jobs miracle in this country, turning the economy around, I think he can be very very proud of.
So that's my view on Dave and what he's got to say.
LK: He's been pretty brutal about you...
BJ: Well. Really? I mean you know. I think that he has a lot to be proud of and there you go.