According to Wednesday's deal, OAO Gazprom will sell gas to a trading company for $230 per 1000 cubic metres and Ukraine will buy gas from the company for $95.
The heads of the two state-controlled companies, Gazprom and Naftogaz, announced the conclusion of a five-year contract at a joint news conference in Moscow.
"The talks ended successfully for Gazprom, and Gazprom is completely satisfied," said Alexei Miller, the Gazprom chief.
End of dispute
He signalled an end to the furious dispute that had engulfed not only the two companies but the Russian and Ukrainian governments and threatened long-term repercussions in Europe.
The trading company, Rosukrenergo, which is jointly owned by Gazprom bank and a Swiss subsidiary of Austria's Raiffeisen Bank, can charge differing prices to Ukraine because it receives gas from Turkmenistan as well, said Sergei Kupriyanov, the Gazprom spokesman.
Ukraine buys gas from the Central Asian nation for a significantly lower price.
"We are satisfied with the talks. We reached a broad-based agreement on mutually acceptable terms"
chief of Naftogaz
Kupriyanov said that the agreed price was $230 as of 1 January but that it would fluctuate with the market.
He did not indicate how often the price would be adjusted.
Oleksiy Ivchenko, the chief of Naftogaz, said that the two companies had also agreed to raise the transit fee Gazprom pays to send its gas through Ukrainian pipelines from $1.09 to $1.60 per thousand cubic metres to travel 100km, a 47% increase.
"We are satisfied with the talks. We reached a broad-based agreement on mutually acceptable terms," he said.
"Our relationship is shifting completely to a market basis."
A meeting of representatives of European Union member states and the gas industry was scheduled later on Wednesday in Brussels to discuss how they would react to the crisis and deal with future threats to Europe's gas supply.
$230 is the price Gazprom had demanded that Kiev pay, a more than fourfold increase over the 2005 price, and Ukraine had resisted, saying that while it favored paying market prices it needed them phased in over several years.
Although European countries including Austria, Slovakia and Hungary reported their gas supplies had returned to normal on Tuesday, the gas fight has reawakened European fears over Russia's reliability and potential for belligerence.