* HSBC places fair value of $468.2 million on stake as of Sept. 30
* Santander says eyeing China trade flows with Latam
* Bank of Shanghai expected to list shares in HK, Shanghai
By Sarah White and Matt Scuffham
MADRID/LONDON, Dec 11 (Reuters) - Santander, Spain's largest bank, has agreed to buy HSBC's 8 percent stake in Bank of Shanghai, expanding its presence in China at a time when other foreign banks have hit the exit button.
Santander, which already has a consumer finance venture and a car financing business in China, said on Tuesday the deal also included a cooperation agreement with the Chinese bank, taking the value of its investment to 470 million euros ($647.3 million).
The deal is seen helping Bank of Shanghai move a step forward with an expected initial public offering by giving it a secure foreign investment and a valuation. The Chinese lender is seeking an IPO in Shanghai and Hong Kong with a combined value of about $2 billion.
Bank of Shanghai officials could not be immediately reached for comment on the deal or the IPO plans.
HSBC had earlier flagged its interest in selling the stake, which it said had a fair value of HK$3.63 billion ($468.18 million) as of Sept. 30. The Asia-focused bank paid $62.6 million for the holding in Dec. 2001.
HSBC has also been selling minority holdings as part of a restructuring since the start of 2011. It has cut 46,000 jobs and sold or closed 52 businesses, including a minority stake in Chinese insurer Ping An.
U.S. and European banks, including Bank of America, Goldman Sachs and UBS have also sold their stakes in Chinese banks, booking hefty profits from holdings that yielded few strategic advantages. Regulatory and other business reasons also prompted the sales.
Santander, however, is moving in the other direction.
The bank said it would help state-controlled Bank of Shanghai, which it said had 98 billion euros of assets and was the second-biggest city-focused commercial and retail bank in the country, with training in areas such as risk management.
It is also planning to develop a joint wholesale banking business, adding to what Santander might be able to offer some of its big corporate clients in Latin America, a key hub that provides around 50 percent of its profits.
"Santander is also developing investment banking activities in China, mainly based on financing the substantial trade flows between the Asian giant and Latin America," the bank said in a statement which listed existing ventures in China.
Asia-focused HSBC said China was still one of its priority markets and Chief Executive Stuart Gulliver has said in recent months that its 19 percent stake in Bank of Communications remained core.
The transaction is subject to approval from the China Banking Regulatory Commission.
Gulliver had said in May that HSBC could sell its Bank of Shanghai stake for between $500 million and $600 million. Santander declined to comment on Tuesday on how much it had paid for the 8 percent stake alone.
Santander also has 20 percent of Bank of Beijing's consumer finance subsidiary and earlier this year launched a 50/50 joint venture in car financing with Anhui Jianghuai Automobile (JAC) .
Peers have been selling out of China in part because some struggled to make quick progress with their Chinese joint ventures, and also because they are bulking up capital ahead of more stringent international solvency rules.
Santander's main rival in Spain, BBVA, recently trimmed its stake in China's CITIC Bank Corp to just under 10 percent, as having stakes in foreign banks will become more expensive over that limit under new capital regulations.
Santander has sold assets elsewhere in recent years, including in Latin America. But it has been in a more acquisitive mode in recent months, even in its home market Spain, which is slowly emerging from a five-year economic slump.
In October it spent 140 million euros on a 51 percent stake in the Spain's largest consumer finance business, run by department store chain El Corte Ingles.
Santander said it expected its deal with Bank of Shanghai to close in the first half of 2014. It said the transaction would impact its capital to risk-weighted assets ratio by about 0.01 percent.