By Colin Packham, Nobuhiro Kubo and Tim Kelly

SYDNEY/TOKYO (Reuters) - France has beaten Japan and Germany to win a A$50 billion ($40 billion) deal to build a fleet of 12 submarines for Australia, one of the world's most lucrative defense contracts, Australian Prime Minister Malcolm Turnbull announced on Tuesday.

The victory for state-owned naval contractor DCNS Group underscored France's strengths in developing a compelling military-industrial bid, and is a blow for Japanese Prime Minister Shinzo Abe's push to develop defense export capabilities as part of a more muscular security agenda.

Reuters earlier reported that DCNS would be announced as the winner, citing sources with knowledge of the process.

"The recommendation of our competitive evaluation process ... was unequivocal that the French offer represented the capabilities best able to meet Australia's unique needs," Turnbull told reporters in the South Australian state capital of Adelaide where the submarines will be built.

In a statement, French President Francois Hollande said the deal "marks a decisive step in the strategic partnership between our two countries", while Prime Minister Manuel Valls said it was "cause for optimism and pride."

The French shipbuilder's share of the overall contract will amount to about 8 billion euros ($9.02 billion), according to sources with knowledge of the deal. DCNS chief Hervé Guillou said the deal would create around 4,000 French jobs, benefiting shipyards and industrial sites in Lorient, Brest, Nantes and Cherbourg.

Australia is ramping up defense spending, seeking to protect its strategic and trade interests in Asia-Pacific as the United States and its allies grapple with China's rising power.

Japan's government with its Mitsubishi Heavy Industries <7011.T> and Kawasaki Heavy Industries <7012.T> boat had been seen as early frontrunners for the contract, but their inexperience in global defense deals and an initial reluctance to say they would build in Australia saw them slip behind DCNS and Germany's ThyssenKrupp AG .

Story continues

POLITICAL IMPLICATIONS

Industry watchers had anticipated a decision to come later in the year, but Turnbull's gamble on a July 2 general election sped up the process.

The contract will have an impact on thousands of jobs in the shipbuilding industry in South Australia, where retaining votes in key electorates will be critical for the government's chances of re-election.

"The submarine project .. will see Australian workers building Australian submarines with Australian steel," said Turnbull.

DCNS, which traces its roots to 1624 and is 35 percent-owned by defense electronics giant Thales SA , proposed a diesel-electric version of its 5,000-tonne Barracuda nuclear-powered submarine. DCNS enlisted heads of industry and top government figures to convince Australia of the merits of its offering and the benefits to the broader relationship.

"This is a great opportunity for DCNS because they will work with the Australian navy for the long run as it is a series of contracts and a huge opportunity to invest more and to develop business," French Economy Minister Emmanuel Macron said on the sidelines of a trade fair in Hannover, Germany.

Thales shares initially rose more than 3 percent in Paris to a record high.

Japan had offered to build Australia a variant of its 4,000 metric ton Soryu submarine, a deal that would have cemented closer strategic and defense ties with two of Washington's key Asia-Pacific allies, but risked antagonizing China, Australia's top trading partner.

Paul Burton, Defense Industry and Budgets Director at HIS Jane's said it was a surprise from a strategic standpoint that Japan didn’t win. "Japan is very keen to secure a significant piece of overseas business following the relaxation of its export legislation, and this Australian submarine deal was widely regarded as becoming a landmark trade," he said.

"The tradecraft required to convince a sophisticated domestic buyer that Japan's was superior to that offered by France was lacking."

ThyssenKrupp was proposing to scale up its 2,000-tonne Type 214 class submarine, a technical challenge that sources had previously told Reuters weighed against the German bid.

Both losing bidders said they were disappointed by the decision, but remain committed to their Australian businesses.

"Thyssenkrupp will always be willing to further contribute to Australia’s naval capabilities," said Hans Atzpodien, Chairman of Thyssenkrupp Marine Systems.

Japan's Defence Minister Gen. Nakatani said the decision was "deeply regrettable," and he would ask Australia to explain why it didn't pick Japan's design.

America's Raytheon Co , which built the system for Australia's ageing Collins-class submarines, is vying for a separate combat system contract with Lockheed Martin Corp , which supplies combat systems to the U.S. Navy's submarine fleet. A decision on the weapons system is due later this year.

(Reporting by Colin Packham, Nobuhiro Kubo and Tim Kelly, with additional reporting by Matt Siegel in Sydney, Cyril Altmeyer in Paris and Andreas Framke in Hannover; Editing by Lincoln Feast and Ian Geoghegan)