Spain's largest bank Santander has agreed to buy HSBC's 8 percent stake in Bank of Shanghai, the Spanish National Securities Market Commission (CMNV) said Tuesday. Santander would invest around 470 million euros (647 million U. S. dollars) in accordance with the deal, which also includes a technical and strategic cooperation agreement, the CMNV said, adding that Santander expected this deal to be closed in the first semester of 2014. Santander will become the second largest shareholder in Bank of Shanghai, one of the largest city-focused commercial and retail banks in China with 294 branches nationwide. Santander said it would send experts to help in training in commercial banking and risk management as a part of the cooperation agreement. This was Santander's latest investment banking activities in China. The Spanish bank bought 20 percent stake of Bank of Beijing Consumer Finance Company in May, becoming its second-largest shareholder. Santander, in joint venture with China's Anhui Jianghuai Automobile, launched a multi-brand auto finance company Fortune Auto Finance earlier this year.