BRASILIA - Chinese Premier Li Keqiang came to the rescue of Brazil’s slumping economy on Tuesday with trade, finance and investment deals worth tens of billions of dollars in energy, mining, aviation and the upgrade of dilapidated infrastructure. On his first official trip to Latin America, Li saw a raft of agreements signed, ranging from a $1 billion purchase of passenger jets made by Brazil’s Embraer to the lifting of an import ban on Brazilian beef and a long-discussed plan to build a railroad over the Andes to the Pacific. “A new road to Asia will open for Brasil, reducing distances and costs, a road that will take us directly to the ports of Peru and, across the Pacific Ocean, China,” President Dilma Rousseff said, inviting Chinese companies to build it. Brazil and China agreed to study the feasibility of the rail link that would allow Brazilian exports to avoid the Panama Canal. Li put the value of Tuesday’s agreements at $27 billion, while Rousseff said they totaled $53 billion, a ballpark figure that aides said included past and future funding. The injection of capital from China could not come at a better time for Brazil, which is sliding into recession following the end of a commodity boom last decade that was fueled by voracious Chinese demand for its main exports, iron ore and soybeans. As China’s economy slows, Chinese companies are looking abroad for new opportunities to invest and Chinese banks have begun to provide abundant financing. Li said Chinese construction and steel companies were ready to help Brazil overhaul its infrastructure and reduce transport costs for the export of Brazilian commodities. The two leaders announced that the Industrial and Commercial Bank of China Ltd (ICBC), the world’s largest bank by assets, will set up a $50 billion fund with Caixa Econômica Federal, Brazil’s largest mortgage lender, to invest in infrastructure projects in the South American country. The fund was another sign of China flexing its financial might in Latin America, a region that used to be dominated by the United States but where China lent more than the World Bank and the Inter-American Development Bank combined last year. Brazil’s state-led oil company Petroleo Brasileiro SA signed finance agreements worth $10 billion with the China Development Bank, the China Eximbank and the ICBC, the Brazilian government said. The funds come at a time of big challenges for Petrobras. A plunge in oil prices, years of high spending, project delays and a huge corruption scandal have squeezed its ability to generate cash and made financing new projects more expensive. Li and Rousseff watched by video the start of construction of a 2,800-kilometer transmission line by China’s State Grid Corp, the world’s largest utility. It will supply power from Belo Monte hydroelectric dam under construction in the Amazon to the energy-hungry industrial state of Sao Paulo. Tianjin Airlines confirmed the purchase of a first batch of 22 E-190 passenger jets made by Embraer, of 60 planes China pledged to buy when President Xi Jinping visited in 2014. The ICBC also agreed to finance the leasing of eight Embraer planes by Brazilian airline Azul. The Bank of Communications Co Ltd, China’s fifth-biggest lender, said it bought 80 percent of Brazilian lender Banco BBM SA for about $174 million, the Chinese bank’s first overseas acquisition. China also ended an embargo on Brazilian beef imports that had been in place since 2012 due to a mad cow scare. Eight Brazilian meat processing plants were approved to ship to China, and 17 more are expected to get the green light in June, opening up potential sales of half a billion dollars, the agriculture ministry said. Brazilian miner Vale said it sold four large iron ore carriers to China Merchants Energy Shipping Co, as it looks to raise cash in the middle of an iron ore price slump. It also got a pledge for a credit line of $4 billion from the ICBC.