LONDON — Hopes for a breakthrough in the Brexit negotiations between Prime Minister Boris Johnson and the European Union have surged in recent days, but the positive mood music from diplomats masks a harder reality for Mr. Johnson: He may be forced into concessions that make his deal impossible to sell at home.

The prime minister is frantically trying to bridge a gap over the thorny issue of how to treat Northern Ireland in a post-Brexit Europe in time for a crucial summit meeting of the European Union later this week, two people briefed on the talks said.

The down-to-the-wire talks between British and European diplomats began on Tuesday morning, with some European officials predicting that the two sides would never close the divide. As the day wore on, however, the negotiators seemed to draw closer, and news of a potential deal trickled into the financial markets, where traders drove up the British pound.

The closed-door talks in Brussels continued into early Wednesday morning. In London, Mr. Johnson said nothing publicly and met privately with a parade of skeptics from his own Conservative party and unionists from Northern Ireland.