Russia and Ukraine have been under intense pressure from the European Union to resolve their dispute over gas.
The falling out has resulted in cuts to gas supplies to much of eastern Europe since early January and damaged both countries' reputations as reliable energy partners.
But following all night talks Russian premier Vladimir Putin and his Ukrainian counterpart Yulia Tymoshenko told reporters they had come to an agreement.
Putin said they had agreed that Ukraine would switch to paying the European rate for its gas from Russia.
However this year they would have a 20 per cent discount in return for preferential transit rates.
Tymoshenko said the talks were difficult but they had managed to reach an understanding.
She said Russia and Ukraine's gas companies, Gazprom and Naftogaz would sign a contract.
Russia cut off supplies to Ukraine on January the first because it would not pay higher prices for gas.
Six days later export flows to easter Europe through Ukraine ceased.
Now Russia has said supplies would normalise in the very near future.
Penny Tweedie, Reuters.