* Deal cuts commercial real estate portfolio by 16 pct
* Japan commercial real estate portfolio amounts to 0.7 bln euro
* Spanish, Portuguese portfolios total 4.4 bln euros (Adds details, background)
FRANKFURT, June 11 (Reuters) - Commerzbank has sold 5.1 billion euros ($6.94 billion) in property assets in Spain, Japan and Portugal in a move to shed risky assets from its balance sheet in one of the biggest deals of its kind since Spain's 2008 real estate crash.
The sale, code named "Project Octopus", positions Germany's second-largest bank to surpass its own targets for offloading underperforming assets from its internal bad bank and slimming back its balance sheet.
Commerzbank sold the assets for between 3.7 billion euros and 3.9 billion euros, a source close to the transaction said, confirming a Reuters report published in May.
The deal will lighten Commerzbank's balance sheet by 3.2 billion euros in risk weighted assets and cost the bank 100 million euros in charges in the second quarter, the bank said.
Commerzbank, capitalising on renewed investor appetite for Spanish real estate to tidy its finances, was one of the highest-profile casualties of the global financial crisis, with the German government spending around 18 billion euros ($25 billion) to bail it out.
It has since cut costs and sold assets, returning to profit in 2013. But like rivals it is struggling with low interest rates and weak fixed-income markets, and also faces growing competition for its core mid-sized company customers - the backbone of Europe's largest economy.
U.S. investment bank JPMorgan and private equity house Lone Star formed a consortium to purchase Spanish commercial real estate (CRE) loans and non-performing loans in Portugal, Commerzbank said in a statement on Wednesday.
A 700 million euro Japanese CRE portfolio was sold to Asia-focused alternative investment manager PAG, it added.
The portfolio is one of the largest sold in the wake of Spain's real estate market collapse in 2008. House prices have fallen around 40 percent since then, hurting banks exposed to the sector and pushing some Spanish lenders into state bailouts.
Foreign investors have flocked to Spain in search of real estate bargains, but many banks were initially reluctant to sell at big discounts, and large portfolio auctions have been rare.
In the past year, however, more deals have emerged as Spanish banks, and some in other countries, have booked hefty provisions against losses and are in a stronger position to sell loan portfolios at discounts.
Shares in Commerzbank rose 0.6 percent, while the overall market for European bank shares was down by 0.9 percent. ($1 = 0.7345 Euros) (Reporting by Thomas Atkins, Alexander Huebner and Arno Schuetze; Editing by Jonathan Gould and Louise Heavens)