LONDON, July 28 (Reuters) - Yields on euro zone government bonds surged on Friday after the Bank of Japan surprised markets by tweaking its monetary policy, before paring their gains.

Investors were also sifting through economic data from the euro zone, which showed that some of the bloc's top economies displayed unexpected resilience in the second quarter.

The BoJ on Friday maintained guidance allowing the 10-year yield to move 0.5% around the 0% target, but surprised markets by saying that those would now be "references" rather than "rigid limits". It signalled it would tolerate a rise to 1%.

Japan's 10-year bond yield climbed to a nine-year high of 0.579% and last traded at 0.57%. Yields move inversely to prices.

The change jolted euro zone bonds, with the yield on Germany's benchmark 10-year bond rising more than 10 basis points (bps) to 2.554%. It then gave up ground and was last up 2 bps at 2.46%.

Japanese investors hold large amounts of foreign debt thanks to a history of high savings and low domestic interest rates. Some analysts worry that a jump in Japanese bond yields could make domestic assets look more attractive, causing a rush out of Europe.

Commerzbank analysts said Japanese investors held more than 160 billion euros ($175.49 billion) of long-term French debt securities at the end of 2022, for example.

Christoph Rieger, head of rates and credit research at Commerzbank, said in a note to clients that the BoJ's decision had therefore driven up 10-year euro zone yields on Friday.

Yet he said he does not expect "a more lasting structural sell-off", because Japanese investors already sold foreign bonds at a rapid rate last year as the costs of currency hedging rose in line with foreign borrowing costs.

France's 10-year yield jumped as high as 3.122%, but was last up 3 bps at 3.02%.

Piet Haines Christiansen said the impact of tweak on global markets would depend on how high the BoJ will allow the 10-year yield to move.

"If it was a firm, hard cap we should have seen a much bigger reaction in Japan," he said, pointing to the fact that the yield has not neared 1%.

Economic data painted a mixed picture for investors. Germany's gross domestic product stagnated in the second quarter, but the French and Spanish economies grew at a sustained pace on the back of stronger exports and tourism.

Germany's two-year yield, which is highly sensitive to interest rate expectations, was last down 3 bps at 3.189%.

Inflation data showed that price growth in France cooled slightly more than expected to 5% in July, from 5.3% in June.

Spanish inflation came in at 2.1%. Analysts had expected it to stay at 1.6% from June.

Yields fell slightly on Thursday as the European Central Bank raised interest rates to 3.75% but refused to say whether it would hike again in September.

Greek central bank chief Yannis Stournaras said that a further rise in euro zone interest rates in September looked "difficult", in an interview with a Greek news website released on Friday.

France's central bank head Francois Villeroy de Galhau said on Friday that ECB rate setters' decisions will be guided entirely by economic data.

According to pricing in derivatives markets, traders on Friday expected the ECB to hike rates to a peak of 3.87% in December, down from 3.94% on Thursday before the ECB decision.

(Reporting by Harry Robertson; Editing by Nick Macfie and Angus MacSwan)