Omar Marques/SOPA Images/LightRocket via Getty

Deutsche Bank (DB - Get Report)  shares topped the German market Monday after the country's biggest lender confirmed the worst-kept secret in European finance over the weekend by revealing it is in talks with rival Commerzbank AG (CRZBY) over a potential merger.

The tie-up talks, which both lenders insisted were only at the very earliest stages, would create Europe's third-largest bank with a market value of around €25 billion alongside a $2 trillion balance sheet. From the Germany government's perspective, given its 15% stake it Commerzbank, it would also create a bank that could both compete on a global stage and continue to support a stable base of lending to Germany's small and medium sized companies -- known as the mittelstand -- which are the lifeblood of Europe's biggest economy.

"In light of arising opportunities, the management board of Deutsche Bank has decided to review strategic options," the bank said in a brief statement Sunday. "In doing so, the management board of Deutsche Bank is focused on improving the growth profile and profitability of the bank."

"There is no certainty that any transaction will occur," the statement added. "In this context we confirm that we are engaging in discussions with Commerzbank."

Deutsche Bank shares were marked 4.12% higher at the start of trading to change hands at €8.13 each, extending their year-to-date gain to around 14%, while Commerzbank gained 7.56% to trade at €7.64 each by mid-day in Frankfurt.

Deutsche Bank merger with Commerzbank fills a huge void--very positive

— Jim Cramer (@jimcramer) March 18, 2019

While the move has been pushed by both investors and the German government, it may also face stiff opposition from the country's powerful unions, the largest of which came out against any potential tie-up Monday amid concerns for the massive job cuts it would likely require.

"In our opinion a possible merger would not result in a business model that is sustainable in the long term," said Jan Duscheck Duscheck, a member of Germany's Verdi union who also sits on Deutsche Bank's supervisory board, during and interview with broadcaster N-TV. 

Duscheck said as many as 10,000 jobs were under immediate threat from the merger, with a further 20,000 at risk over the longer term as the two lenders combine overlapping branches and businesses across Europe's largest economy.

Last month,  Deutsche Bank posted a wider-than-expected fourth quarter loss that overshadowed the troubled lender's first annual profit in four years and reminded investors of the near-term challenges in a low growth, low interest rate backdrop in Europe.

"In 2019 we aim not only to save costs but also to make focused investments in growth. We aim to grow profitability substantially through the current year and beyond," CEO Christian Sewing said at the time.

Deutsche Bank has also been hammered by a series of negative headlines and scandals over the past years, the latest linked to European antitrust regulators charging four regional lenders with taking part in a bond trading cartel that lasted at least seven years.

Earlier this month, however, Bloomberg reported that Qatar's multi-billion sovereign wealth fund was in "advanced" talks with Deutsche Bank to boost its current holding, estimated at around 6.1%, while noting that the timing of such an increase was uncertain.

Last year, the QIA said it would invest around $10 billion of its $320 fund in German, while the fund's chairman, Sheikh Mohammed bin Abdulrahman Al Thani, hinted last week at the World Economic Forum in Davos that financial services firms could be potential targets.