Boris Johnson and Leo Varadkar have agreed there is a “pathway to a possible Brexit deal”, surprising sceptical EU officials with their upbeat assessment after more than three hours of private talks.

The British prime minister hosted his Irish counterpart at a country house in the north-west of England for talks on Thursday that had been expected to break down. But when the pair emerged from discussions they painted a more optimistic picture, suggesting the Brexit logjam could be broken by the end of the month.

The pair issued a positive joint statement, although Varadkar said afterwards that while he believed the outline of a deal would be possible in time for the crunch summit of EU leaders next week, serious challenges remained and there was “many a slip between cup and lip”.

The relatively warm words from the taoiseach came just days after he said finding an agreement would be “very difficult”, suggesting Johnson would have to move on the issue of customs and how Northern Ireland consented to the Brexit plans.

Downing Street declined to comment on whether Johnson had shifted, but any concessions to the EU could prove problematic for the prime minister as he seeks the support of Eurosceptic hardliners and the Democratic Unionist party (DUP) in getting his deal through parliament.

European officials were also reluctant to publicly comment on the significance of the talks in Wirral, with one diplomat saying the two sides would have to work nights to reach a successful outcome. “Twenty-three days for a deal,” the diplomat said. “Ambitious. And that doesn’t take into account implementing it in the UK.”

There were also suggestions that both sides were keen to cast the talks in a positive light to avoid being held responsible for their failure.

With speculation rampant over the detail of the discussions, Varadkar will now brief the EU27 negotiating teams led by Michel Barnier about whether sufficient progress has been made for in-depth talks to start before next Thursday’s summit.

Stephen Barclay, the Brexit secretary, was expected to meet chief EU negotiator Michel Barnier for a working breakfast on Friday to discuss the leaders’ meeting.

One source said Brussels had been briefed that the new proposal on customs involved Northern Ireland leaving the customs union but “following” the EU customs rules.

In a joint statement, Dublin and London said: “Both continue to believe that a deal is in everybody’s interest. They agreed that they could see a pathway to a possible deal.

“Their discussion concentrated on the challenges of customs and consent. They also discussed the potential to strengthen bilateral relations, including on Northern Ireland.”

Quick guide Why is the Irish border a stumbling block for Brexit? Show Hide Counties and customs Inside the EU, both Ireland and Northern Ireland are part of the single market and customs union so share the same regulations and standards, allowing a soft or invisible border between the two.

Britain’s exit from the EU – taking Northern Ireland with it – risks a return to a hard or policed border. The only way to avoid this post-Brexit is for regulations on both sides to remain more or less the same in key areas including food, animal welfare, medicines and product safety. The 'backstop' in Theresa May's Withdrawal Agreement was intended to address this - stating that if no future trade agreement could be reached between the EU and the UK, then rules and regulations would stay as they are. This has been rejected by Brexit supporters as a 'trap' to keep the UK in the EU's customs union, which would prevent the UK striking its own independent trade deals. There are an estimated 72m road vehicle crossings a year between Northern Ireland and the Republic of Ireland, and about 14% of those crossings are consignments of goods, some of which may cross the border several times before they reach a consumer. Brexit supporters say this can be managed by doing checks on goods away from the border, but critics say it will be difficult to police this without any physical infrastructure like border posts or cameras, which could raise tensions in the divided communities of Ireland.

Interactive: A typical hour in the life of the Irish border Photograph: Design Pics Inc/Design Pics RF

Afterwards, Varadkar told reporters: “I think it is possible to come to an agreement to have a treaty agreed to allow the UK to leave the EU in an orderly fashion and to have that done by the end of October.”

He added that it was “very positive and very promising … I am now absolutely convinced that both Ireland and the UK want there to be an agreement that’s in the interests of Ireland and the UK, and the EU as a whole.”

He added that he hoped the outcome of the talks would be sufficient to allow negotiations to resume.

“I do see a pathway towards an agreement in the coming weeks,” Varadkar said. “There are, of course, issues yet to be fully resolved: the first is the issue of consent and democracy, ensuring that any long-term arrangement that applies to Northern Ireland has the consent of the people of Northern Ireland; the second is the whole issue of customs, ensuring that there is no customs border between the north and the south; and also we had a good discussion looking forward to how relationships might look after Brexit, how we can strengthen cooperation north and south economically and politically, and also between Britain and Ireland.”

The pound soared on the international currency markets after Varadkar’s remarks, reflecting rising optimism in the City over the possibility of a deal.

Sterling jumped by about 2 cents against the dollar and the euro to the highest levels in a week, coming close to $1.24 and €1.13 on the foreign exchanges. Despite the gains, the pound remains heavily down from spring this year when hopes of a deal with Brussels were at their highest.

The leaders’ meeting lasted three hours, significantly longer than expected, with sufficient movement on both sides to allow the pair to agree that there was now a basis for substantive negotiations.

There was no further detail on how the two sides could reach a compromise, but it will revive Johnson’s hopes for a deal at next week’s summit. The two men met alone and at one stage went for a walk together, before being joined by officials nearer the end, raising questions about whether either side could have overinterpreted the extent of concessions each was willing to make. It has been confirmed that Johnson’s controversial adviser Dominic Cummings was present for part of the meeting.

Nissan: no-deal Brexit would jeopardise entire European business model Read more

Asked what concessions both sides had made, Varadkar said: “I don’t think this should be seen in the context of who is making concessions, or winners and losers. I don’t think that’s the game any of us want to play.”

The key stumbling blocks to a deal for Ireland have been Johnson’s proposal to take Northern Ireland out of the EU customs union on Brexit day, and his plan to give the defunct Stormont assembly the final say on whether the country should also stay aligned to EU rules on goods and agrifood.

On customs, the EU is unconvinced that Northern Ireland’s departure from the EU customs zone is compatible with maintaining an open border on the island of Ireland and protecting the EU single market from dangerous, undertaxed or illegal goods.

On consent, the EU has rejected the British government’s proposed veto for the DUP over Northern Ireland being part of an EU zone for agrifood goods and products. Brussels thinks this form of regulatory alignment aimed at keeping the border open would not work if it had a Stormont vote hanging over it every four years.