RIO DE JANEIRO—Brazil and China signed a preliminary deal to set up local currency swaps that will allow each country to tap the other's central bank for up to $30 billion, Brazilian Finance Minister Guido Mantega said Thursday.

The agreement was part of a wide-ranging bilateral trade deal between the two emerging-market powers announced at the United Nations Conference on Sustainable Development, or Rio+20, after meetings between Brazilian President Dilma Rousseff and Chinese Prime Minister Wen Jiabao. The 10-year deal also...