LONDON - The British pound extended its recent run on Friday after European Commission President Jean-Claude Juncker said that agreeing a Brexit deal with the United Kingdom was still possible.

Juncker said a withdrawal agreement could happen if the Irish border backstop, which the British government wants removed, could be replaced with alternatives.

British Prime Minister Boris Johnson has vowed to take his country out of the EU on Oct. 31, with or without a deal, but UK lawmakers have voted to force him to seek a delay to the departure if he cannot strike a new agreement with Brussels.

Johnson's government has since stepped up efforts to try and renegotiate the deal agreed by previous Prime Minister Theresa May but repeatedly rejected by Britain's parliament.

The Irish Foreign Minister said on Friday that London and the EU were not yet close to a Brexit deal that could resolve the Irish border riddle but he added that the "mood music" had improved.

Building on overnight strength, sterling rallied as much as 0.5% versus the dollar to a two-month high in early trade, and it powered to a 4-month peak versus the euro at 87.87 pence.

The pound was last up 0.1% at $1.2538.

The British currency has risen from under $1.20 earlier this month as investors slashed their bets against the pound because of perceived receding risks of a no-deal Brexit.

But some analysts think investors may be getting ahead of themselves.

"Markets are at risk however of reading too much into Juncker's comment, and it remains to be seen whether the pound can push on from current levels," said Han Tan, an analyst at FXTM.

"Should Juncker's perceived optimism over a Brexit deal be found wanting and the UK-EU impasse become evident once again, the pound may very easily unwind recent gains and falter back towards the 1.20 mark against the dollar."

(Reporting by Saikat Chatterjee and Tommy Wilkes; Editing by Pravin Char) ((saikat.chatterjee@thomsonreuters.com; +44-20-7542-1713; Reuters Messaging: saikat.chatterjee.reuters.com@reuters.net))