Russian President Dmitry Medvedev arrived in China on Sunday to expand energy cooperation between the two countries. The new deal includes building a 13-million-ton-per-year oil refinery in the city Tianjin within two years. Russia would supply 70 percent of the oil for the $5 billion refinery in a 20-year deal.

In August, Russia opened its section of a 625-mile (1,000 km) oil pipeline from Skovorodino in the Far East to China. The pipe connects Russian oil fields with Daqing, a major oil production region in northeastern China. Russia is also pushing for natural gas deals, but negotiations are stumbling over Chinese demands for low prices.

Medvedev’s trip to China coincided with a significant deterioration in U.S.-China relations. Disputes over sovereignty in the South China Sea and China’s currency manipulation have negatively affected ties between these two countries.

In the recent decade China and Russia attempted to counterbalance the United States, signing declarations calling for a stronger U.N. role in global affairs, opposition to “U.S. hegemony”, and a strengthening of the two nation’s economic and security partnership.

Moscow and Beijing lead the Shanghai Cooperation Organization, established in 2001, a regional security group that also includes the ex-Soviet Central Asian nations of Uzbekistan, Kazakhstan, Kyrgyzstan, and Tajikistan.

China was the leading customer of the Russian military-industrial complex in the 1990s and in the early 2000s.

Furthermore, Russia is currently seeking new markets for its energy supplies, diversifying its exports away from the EU to Asia, while China constructed a giant natural gas pipeline from Turkmenistan.

Although China was the first major power Medvedev visited as president, Russian principal energy deals have been, until recently, conducted under Prime Minister Vladimir Putin’s purview.

Therefore, the real question is whether Russian President’s visit to, and deals with, China are another attempt by Medvedev to boost his leadership—(in the aftermath of the firing of the Mayor of Moscow Yuri Luzhkov) —or simply an errand that he is running for Mr. Putin?