China would become Russia's No. 2 gas market, behind Germany, under the deal, which would also tighten ties between the two neighbors as they seek a way to counterbalance U.S. influence in the world. Mr. Putin signed the accord with Chinese President Xi Jinping while on a two-day visit to Shanghai.