TIMELINE-Key moments leading up to Johnson's Brexit deal

Oct 21 (Reuters) - UK Prime Minister Boris Johnson sealed a new Brexit deal with the European Union on Oct. 17, paving the way for Britain to leave the bloc at the end of the month, if Britain's parliament approves it.

Here are the key moments in talks this year that produced the new agreement more than three years after Britons narrowly voted to leave the EU.

July 24

A leading face of the Vote Leave campaign, Johnson becomes Britain's prime minister. He promises to renegotiate the stalled Brexit agreement and take his country out of the bloc on Oct. 31.

Aug. 23

Johnson commits a gaffe in Paris at his first face-to-face meeting with French President Emmanuel Macron by putting his feet on a table in the gilded Elysee Palace in front of cameras. Behind closed doors, however, he is all business.

Aug. 24-26

Johnson makes his first appearance at the annual G7 gathering of leaders of the world's most advanced economies. He manages a delicate balancing act between the wary EU and U.S. President Donald Trump. He tells the bloc's leaders in private that he wants a deal but is prepared to leave without one.

Sept. 3

Johnson loses his working majority in the British parliament as one of his lawmakers defects to a pro-EU party, meaning that parliamentary ratification of any Brexit deal would be in doubt. Johnson then suspends 21 Conservative lawmakers for defying him on Brexit.

Sept. 9

Britain's lower parliamentary chamber, the House of Commons, passes legislation known as the Benn Act stipulating that Johnson must request a delay to Britain's exit from the EU until Jan. 31, 2020 if the government does not have parliamentary approval to leave, with or without a deal, by Oct. 19.

Sept. 16

Johnson and European Commission head Jean-Claude Juncker lunch in Luxembourg. The head of the powerful EU executive tells Johnson he must move if he wants a deal.

Johnson then meets Luxembourg Prime Minister Xavier Bettel, but skips a news conference amid noisy street protests. Gesturing to an empty lectern, Bettel channels the bloc's exasperation with the tortuous Brexit negotiations.

Sept. 23-24

From mid-September, technical talks between the EU and Britain intensify but disagreements persist. Johnson fails to agree on how to resolve differences over Brexit during his meetings with EU leaders at the United Nations.

Oct. 1

As the annual conference of his Conservative Party ends, Johnson presents a new idea for a reworked Brexit deal that would effectively create two borders - a regulatory one in the Irish sea and a customs one between Ireland and Northern Ireland.

The EU rejects it as not providing enough protection for its cherished single market, but notes Johnson's first major change in position to allow Northern Ireland to remain aligned with the bloc's rules for trade in animal, food and manufactured goods after Brexit.

Oct. 8

Johnson has a call with German Chancellor Angela Merkel who tells him that the EU would not accept customs checks on the island of Ireland.

Johnson's aides tell reporters that a deal is "essentially impossible - not just now, but ever." Talks are on the verge of collapse.

Later that day, however, Johnson speaks to Irish leader Leo Varadkar on the phone. They both say they want an agreement and decide to meet in person.

Oct. 10-16

The two men meet in a manor house outside Liverpool on Oct. 10. Johnson concedes that customs checks would be carried out between Northern Ireland and mainland Britain. Varadkar moves away from insisting on the backstop fix for the Irish border.

They conclude they see "a pathway to deal," although details remain to be worked out.

The next morning in Brussels, EU and UK negotiators begin last-ditch talks that go well into the night and through the weekend. A tentative deal is sealed in Brussels on Oct. 16.

Oct. 17

Johnson and Juncker conclude an agreement around 0900 GMT. The other 27 EU national leaders meet in Brussels for a summit four hours later and endorse the new deal.

Oct. 19

In a rare Saturday session, Britain's House of Commons withholds support for the deal, voting to force Johnson to ask the EU for another delay. (Compiled by Gabriela Baczynska Editing by Bill Rigby)