* German stocks outperform European peers
* Deutsche Bank gains after passing Fed stress test
* Merlin Entertainments soars after buyout offer (Updates to close)
By Sruthi Shankar and Amy Caren Daniel
June 28 (Reuters) - A surge in German shares helped European equities mark their best first-half performance in over two decades on Friday, with investors awaiting the outcome of U.S-China trade talks to see if the rally can continue.
The pan-European STOXX 600 closed up 0.7%, with Frankfurt's trade-sensitive DAX outperforming other major indexes with a 1% rise, aided by top lender Deutsche Bank AG.
The bank's shares rose 3.3% after it passed an annual health check by the U.S. Federal Reserve.
Gains on the main STOXX index were broad-based, with sectors exposed to trade tensions, such as technology and automakers, climbing.
Investors are looking ahead to talks between U.S. President Donald Trump and Chinese President Xi Jinping over their long-drawn trade dispute at the sidelines of the G20 summit on Saturday. Trump said he hoped for productive talks with China, but said he had not made any promises about a reprieve from escalating tariffs.
While most investors do not see both sides striking a trade deal, Trump is expected to hold off from imposing new tariffs on Chinese goods.
"The market is still hoping that there might be a positive communication after the meet," said Rabobank strategist Bas Van Geffen.
The STOXX index enjoyed its best first half yearly gains since 1998 on Friday, rising 14.5%, on expectations that major central banks would be more accommodative to counter the impact of the tariff dispute.
"What we see with this positive first half of the year is when the Fed started turning around. And if you actually see the Fed follow through this, you might see the momentum more or less intact," said Geffen.
Also on investors' radar is a standoff between Switzerland and the European Commission over a stalled partnership treaty, with the Swiss government triggering measures to counter Brussels' refusal to extend recognition to Swiss stock markets.
Starting on July 1, the Swiss will forbid European Union trading venues from offering or facilitating trading in certain shares of companies with a registered office in Switzerland.
Swiss stock index shrugged off the news to rise 0.4%. Bourses in Paris, Madrid and posted gains between 0.6% and 0.9%, while London-listed stocks lagged with a 0.3% rise as energy stocks fell.
Travel and leisure stocks led gains on the main STOXX index, with a 1.6% rise after shares of Madame Tussauds owner Merlin Entertainments jumped 14%.
Merlin said it would be acquired by Lego's founding family and private equity firm Blackstone Group in a deal valuing the company and its debt at nearly 6 billion pounds ($7.6 billion). (Reporting by Sruthi Shankar and Amy Caren Daniel in Bengaluru; Editing by Bernard Orr, William Maclean)