LONDON/NEW YORK (Reuters) - A deal on Britain’s departure agreed with the European Union sent sterling to a five-month high on Thursday and hoisted European stocks to a 1-1/2-year peak before doubts about UK parliamentary support brought them back to earth.

Wall Street rose as upbeat earnings from Netflix and Morgan Stanley affirmed a strong start to the U.S. reporting season, while the dollar fell against the euro as the common currency got a lift on the long-awaited Brexit deal.

But the Irish border riddle remained a Brexit sticking point for Northern Ireland’s Democratic Unionist Party (DUP), which withheld its backing for the deal with the EU and created doubt among investors.

The DUP’s opposition reduces the chances of British Prime Minister Boris Johnson winning parliamentary ratification at the extraordinary session of parliament on Saturday. But after weeks of negotiations, British and EU leaders welcomed an agreement being struck.

“Where there is a will, there is a deal - we have one!” said European Commission President Jean-Claude Juncker as the news broke from Brussels.

Sterling, the key gauge of Brexit sentiment, jumped as much as a 1% against the dollar, putting it on course for its best six-day gain in more than 30 years before the doubts and grumbles set in.

But market optimism faltered when the Northern Ireland party said it could not support the agreement.

Having run up as far as $1.2988 GBP=, sterling fell well under $1.28 before regaining momentum to trade at $1.2863, up 0.26% on the day.

European shares edged lower, even as fading optimism over the Brexit deal was offset by strong earnings from Sweden’s Ericsson.

FILE PHOTO: Traders work on the floor at the New York Stock Exchange (NYSE) in New York, U.S., October 3, 2019. REUTERS/Brendan McDermid

MSCI's gauge of stocks across the globe .MIWD00000PUS gained 0.34%.

France's CAC 40 index .FCHI eased 0.4% after hitting a fresh 12-year high earlier, while Germany's DAX .GDAXI closed down 0.1%, though near its strongest level in over a year.

Shares in domestically focused British companies and Irish firms, which have been seen as a barometer on Brexit sentiment, also gave up initial gains.

London's benchmark FTSE .FTSE index closed up 0.2% and the broad-market pan-European STOXX 600 .STOXX fell 0.1%, while the FTSEurofirst index .FTEU3 of leading regional European shares slid 0.12%.

UK Gilts GB10YT=RR, German Bunds DE10YT=RR, gold and most other safe havens also rebounded after selling off.

On Wall Street, Netflix Inc NFLX.O shares rose 2.47% in heavy trade after the video streaming service provider added slightly more paying subscribers than Wall Street expected in the third quarter.

Morgan Stanley MS.N gained 1.52% after the big lender beat analysts' expectations for quarterly profit, buoyed by higher revenue from bond trading and M&A advisory fees.

Earnings season is dictating U.S. market moves, which has historically been the case, said Kristina Hooper, chief global market strategist at Invesco.

“The buck stops with earnings,” Hooper said. “The good news is most earnings reports thus far have been positive and that’s provided some nice momentum for the market.”

Once the third-quarter earnings season winds down macro factors are likely to play a bigger role, such as the U.S.-China trade talks, and price swings will pick up, she said.

The Dow Jones Industrial Average .DJI rose 23.9 points, or 0.09%, to 27,025.88. The S&P 500 .SPX gained 8.26 points, or 0.28%, to 2,997.95 and the Nasdaq Composite .IXIC added 32.67 points, or 0.4%, to 8,156.85.

Emerging-market stocks .MSCIEF also gained for a sixth day - their longest winning streak since early April - after U.S. Treasury Secretary Steven Mnuchin said U.S. and Chinese trade negotiators were nailing down a Phase 1 trade deal text for their presidents to sign next month.

The dollar index .DXY fell 0.39%, with the euro EUR= up 0.49% to $1.1124. The Japanese yen JPY= strengthened 0.12% versus the greenback at 108.66 per dollar.

Oil prices rebounded after draw-downs in U.S. fuel inventories, but the gains were capped by a larger-than-expected rise in crude stockpiles and a series of weak economic figures.

Brent crude LCOc1 futures settled up 49 cents at $59.91 a barrel. U.S. West Texas Intermediate crude CLc1 rose 57 cents to settle at $53.93.

Gold rose as weak U.S. retail sales rekindled fears of an economic slowdown and concerns about possible risks to the Brexit deal supported bullion.

U.S. gold futures GCcv1 settled 0.3% higher at $1,498.30 an ounce.