Ukraine moved closer to resolving its monthslong dispute with Russia over natural gas Friday, as mounting economic pain at home—and pressure from Europe—increasingly force the pro-Western government in Kiev into compromising with Moscow.

The outlines of the potential deal, reached in Berlin, show how the Kremlin is shifting from a military to an economic strategy to fight Ukraine's efforts to align itself with the West.

The two sides tentatively agreed that Ukraine would pay $3.1 billion in debt by the end of the year in return for OAO Gazprom, the Russian state-owned gas giant, resuming some deliveries—but only for the winter months and at an above-average price, according to European Union and Russian energy officials.

Ukraine's energy minister was more cautious about the deal, which still needs approval in Kiev and Moscow. But he didn't dispute the size of the payment and signaled Ukraine would be willing to agree to Russia's price for now.

The standoff was one of the most serious economic issues stemming from the Ukraine crisis, with Russia threatening to leave Ukraine without the energy it needs to heat homes and keep its economy running this winter. It also threatened to interrupt the flow of Russian gas through Ukraine to customers farther west—as happened in 2009—leading to energy shortages in Europe.

Ukraine's President Petro Poroshenko bowed to Russian military pressure earlier this month by agreeing to a cease-fire with Russian-backed rebels that left a swath of eastern Ukraine under separatist control. The cease-fire is mostly holding, though scattered violence continues almost daily.

Now he also faces pressure to compromise on the diplomatic and economic fronts.

Russian threats of a trade war led Brussels and Kiev to agree on Sept. 12 to delay a major part of a landmark trade-and-political association deal between Ukraine and the EU that Moscow opposes.

Despite that concession, the Kremlin has demanded the terms of the deal be changed, threatening to impose tariffs on a wide range of Ukrainian imports if its wishes aren't taken into consideration.

Fearing further conflict, EU officials this past week backed off previous assurances the deal wouldn't be reopened, a move likely to increase Russian pressure on Kiev.

The EU continues to keep some pressure on Russia as well. The bloc promised to review its sanctions against Moscow by the end of this month. On Friday, a senior European diplomat said it was likely that the bloc would hold off on any change in policy for now.

"I don't think we can expect relief of sanctions in the next three days," said the official.

The continued fighting has allowed Moscow and the rebels to shift the focus of negotiations with Kiev from securing the border between Russia and Ukraine—which has been a vital conduit for Russian support for the separatists—to drawing a new dividing line farther west between the opposing fighters.

Both sides have agreed to pull back from that line to create a buffer zone. On Friday, military officers from Russia and Ukraine met outside rebel-held Donetsk with observers from the Organization for Security and Cooperation in Europe to discuss the dividing line, Ukrainian and OSCE officials said.

Russia's Foreign Ministry, saying Moscow isn't a party to the conflict, denied its officers had participated. Russia has repeatedly in recent weeks sent convoys of what it says is humanitarian aid to the rebel-controlled regions, ignoring Kiev's objections and, effectively, the border between the countries.

The gas talks in Berlin on Friday were the latest in a series in recent months mediated by the EU.

Ukraine is the main transit route for Russian gas supplies to the 28-member bloc, which relies on Russia for over a third of its gas imports. Six countries, including Bulgaria and Slovakia, are wholly dependent on Gazprom for their supplies.

Russia nearly doubled Ukraine's gas price in April, setting off the dispute. In June, Gazprom halted gas deliveries to Ukraine because of unpaid bills that the company now says have reached $5.3 billion. Ukraine disputes that amount, and both sides have filed lawsuits in a Stockholm arbitration court.

After Friday's talks, EU Energy Commissioner Günther Oettinger, who mediated the talks, and Russia's Energy Minister Alexander Novak described the tentative agreement in similar terms.

"We have reached comprehensive cornerstones for a winter package that can serve as a sustainable interim solution to secure the gas supply for the coming winter into early next year," Mr. Oettinger said.

They said Ukraine would pay down $3.1 billion in unpaid bills by the end of the year. Russia, they said, would sell Ukraine at least five billion cubic meters of gas, roughly 10% of its annual consumption.

"In all, the Russian side and the European Union practically don't have different views on this package," Mr. Novak told reporters.

Ukrainian Energy Minister Yuriy Prodan indicated that Kiev still had concerns, but did say his government may accept the price offered for the winter and was prepared to pay the $3.1 billion.

The price of $385 per thousand cubic meters of gas—which Kiev had previously refused—is above the average of what Gazprom charges many of its clients farther west. It is also more than 40% more than what Ukraine paid before a popular uprising ousted pro-Russian President Viktor Yanukovych in February.

Ukraine had been preparing to endure the winter without any Russian gas—which accounted for nearly 60% of supplies last year—by dipping into fuel kept in storage, as well as negotiating reverse shipments of gas from Hungary and Slovakia. Moscow bitterly opposed those deliveries, however, arguing that the gas being delivered to Ukraine was in fact Russian.

Hungary stopped the shipments to Ukraine on Thursday after Hungarian Prime Minister Viktor Orban met Gazprom Chief Executive Alexei Miller in Budapest this week.

Kiev also planned to cut consumption—reducing temperatures in apartments and cutting supplies of hot water—and scrambled to line up supplies of fuel oil and coal from as far away as South Africa.

But with its economy expected to contract by at least 7% this year, Ukraine could ill afford another economic shock from fuel shortages.

By Anton Troianovski , Gregory L. White