The European Union and the United Kingdom have agreed to a Brexit withdrawal agreement. The agreement paves the way for the U.K. to leave at the end of this month. British Prime Minister Boris Johnson expressed optimism at an EU meeting in Brussels.

(SOUNDBITE OF ARCHIVED RECORDING)

PRIME MINISTER BORIS JOHNSON: Now is the moment for us to get Brexit done and then, together, to work on building our future partnership, which I think can be incredibly positive both for the U.K. and for the EU.

CHANG: Well, Boris Johnson has another hurdle ahead. The deal faces fierce opposition in the British Parliament. And for more on that, we turn now to NPR's Frank Langfitt in London.

Hey, Frank.

FRANK LANGFITT, BYLINE: Hi, Ailsa.

CHANG: All right. So first of all, what is in this deal?

LANGFITT: Well, I think the most important thing about this deal, frankly, Ailsa, is it avoids customs posts on the island of Ireland, which - I got to be honest - I think would have been disastrous. Not only would it have slowed trade, it could have sparked violence. But it does this by creating this requirement that Northern Ireland, which of course is a part of the United Kingdom, would actually do customs checks on some goods coming from the rest of the U.K., across the Irish Sea.

Now, Boris Johnson he more or less promised politicians in Northern Ireland he would not do this, but he clearly saw that this was the only way he could get the EU to consent.

CHANG: I see. OK. So would you say that the EU fared pretty well in this current deal?

LANGFITT: Oh, this is a very good deal for them. I think they were very enthusiastic about it. I think they're proud that they got this done. It's been - I can't even keep track, Ailsa.

CHANG: (Laughter).

LANGFITT: But it's been - it feels like more than two years of negotiations. They're avoiding a hard border. They're curtailing smuggling through these customs checks that I mentioned. Northern Ireland is going to remain aligned with a limited set of EU rules, as to pertain to some goods. That'll reduce the risk of unsafe products slipping into the EU from Northern Ireland. And it's - this is expected to be ratified by the European Parliament. I got to say, though - today, amid all the celebration, there was a bit of melancholy. Donald Tusk is the president of the European Council, and this is how he put it.

(SOUNDBITE OF ARCHIVED RECORDING)

DONALD TUSK: On a more personal note, what I feel today is, frankly speaking, sadness because in my heart, I will always be a Remainer. And I hope that if our British friends decide to return one day, our door will always be open.

CHANG: So there he is sounding as if there's some inevitability here, but this still has to get through the British Parliament. So who are Johnson's toughest opponents in the Parliament right now?

LANGFITT: Well, his biggest problem, Ailsa, is he's - his Conservative Party doesn't have a majority, and he relies on the Democratic Unionist Party, which happens to be, very inconveniently, from Northern Ireland. They have 10 votes, and he's just alienated them by agreeing to what is effectively a customs border in the middle of the Irish Sea...

CHANG: Right.

LANGFITT: ...Which he pretty much promised not to do. So the Democratic Unionists say they're going to vote against this. They will bring - could bring some other Conservative Party lawmakers with them. The vote is going to be on Saturday. It's going to be a big showdown. It is possible that the prime minister could lose this.

CHANG: Well, what happens if Parliament rejects this?

LANGFITT: What will happen is he is now required by law, actually, to ask for an extension from Brussels. One assumes...

CHANG: Again? (Laughter).

LANGFITT: Yes. This would be the third, if I can keep track of all of this. But it also, I think more importantly, could open the door for many opposition party lawmakers in Parliament to push to take this all back to a second referendum to the people.

CHANG: Wow. Yeah.

LANGFITT: So after more than three years of Brexit, what they're saying they want is to give a final say to the people of the United Kingdom.