MOSCOW - Swiftly carrying out his pledge to improve strained ties with neighboring Russia, the new Ukrainian president agreed to a landmark deal on Wednesday to extend the lease on a Russian naval base on Ukrainian territory.
The decision by the Ukrainian president, Viktor F. Yanukovich, represented a sharp reversal in policy and a victory for the Kremlin, which had feared that its military readiness would be undermined if the base were closed.
But the lease extension drew criticism from Ukrainian opposition leaders, who view the base as a symbol of Russian interference in Ukrainian affairs and want their country to have a closer alliance with the West.
The base is located on the Crimean Peninsula on the Black Sea, a place of historic resonance for Russia, which has headquartered its fleet there since czarist times. Mr. Yanukovich's predecessor, Viktor A. Yushchenko, who left office in February, was hostile to the Kremlin and had vowed that the lease would not be renewed after it expired in 2017.
The accord reached Wednesday, which Mr. Yanukovich negotiated with Russia's president, Dmitri A. Medvedev, will add 25 years to the lease on the base, which is in the city of Sevastopol. In return, Russia said it would cut the price of natural gas that it sold to Ukraine by roughly 30 percent, helping to bolster Ukraine's shaky finances.
Ukraine has been under pressure from the International Monetary Fund to reduce subsidies to domestic gas consumers to pare its budget and qualify for a bailout package. To raise money, Mr. Yanukovich had considered selling part of Ukraine's gas pipeline network to Russia, but he appears to have shelved that idea.
Mr. Yanukovich has long had a strong rapport with the Kremlin, and during the presidentialcampaign he declared that Mr. Yushchenko had recklessly alienated Moscow by seeking NATO membership for Ukraine and putting pressure on the Russian military over the fate of the Crimea naval base.
Mr. Yanukovich has said Ukraine should not join any military pacts and should instead act as a bridge between Russia and the West.
The meeting on Wednesday reflected how the formerly icy relations between Kiev and Moscow have changed under Mr. Yanukovich. Mr. Medvedev flew to Ukraine for the talks, having all but boycotted Mr. Yushchenko toward the end of his tenure.
"People in Ukraine and in Russia want us to build warm, neighborly, traditional relations, which have always led our nations to success," Mr. Yanukovich said.
The agreement on the naval base and gas supplies is expected to calm tensions that flared in recent years and had ramifications across Europe. Disputes over gas pricing grew so acrimonious that supplies of Russian gas that were supposed to be transported through Ukraine to Europe were halted in winter, leaving homes without heat.
Residents of Crimea hailed the base agreement as well, pleased that it promised to solidify the Russian presence there. The peninsula was once part of Russia, but was transferred to Ukraine in 1954 when both were part of the Soviet Union. The local population is more loyal to Moscow than Kiev. Under Mr. Yushchenko, Crimea was seen as a potential flash point for a military conflict between the countries.
Arseniy Yatsenyuk, a former Ukrainian foreign minister, said Mr. Yanukovich had no right under Ukraine's Constitution to extend the lease. "For now, it's just paper," Mr. Yatsenyuk said of the deal. "The fact of its signing has no legal significance."
The Russian side, though, seemed relieved to have a friend in the Ukrainian president. After the meeting, Mr. Medvedev and Mr. Yanukovich strolled together through the civic center in Kharkiv and greeted passers-by.
"I haven't been a guest here for a long time," Mr. Medvedev told them. "It's nice that it has taken place at last. We have just signed documents that are very important for both Ukraine and Russia. They will strengthen our friendship and our brotherhood for a long time to come."