MINSK, Belarus (AP) — Belarus has reached an agreement with China to receive a $500-million loan, officials in the ex-Soviet country said Monday.

Belarus’ Finance Ministry said the loan will be provided by the Shanghai office of the China Development Bank.

The Chinese credit offers much-needed cash to Belarus amid a dispute with its main sponsor and ally, Russia.

Belarus relies on cheap Russian energy and loans to maintain its Soviet-style economy, but Moscow has recently raised energy prices and cut some of the subsidies. Russian officials say Minsk should accept closer economic integration if it wants to benefit from lower energy prices.

Some in Belarus fear that such integration could pave the way for a full merger of the two countries, concerns fueled by Russia’s 2014 annexation of Ukraine’s Crimean Peninsula.

Belarusian President Alexander Lukashenko, who has been in power for more than a quarter century, has vowed not to surrender Belarus’ post-Soviet independence, but the opposition in Belarus has remained nervous.

Lukashenko is set to meet Friday with Russian President Vladimir Putin to discuss plans for closer economic integration.