* Shares purchased ahead of LSE talks cast long shadow
* Kengeter denies wrongdoing, but probe has dragged on
FRANKFURT, Oct 26 (Reuters) - In 2014, Carsten Kengeter completed the Patrouille des Glaciers, a gruelling ski and mountaineering race organised by the Swiss military, in 16 hours and 23 minutes.
But his endurance petered out on Thursday following a months-long struggle to remain at the helm of Deutsche Boerse , the German stock exchange operator.
An ongoing investigation into allegations of insider trading has cast a shadow over Kengeter and the exchange since early this year, and with no end in sight, pressure had been intensifying for him to depart.
Deutsche Boerse announced that Kengeter - who has denied any wrongdoing - was resigning to "allow the company to focus its energy back onto clients, business and growth and to avoid further burdens" of the investigation.
The move marks a dramatic end to Kengeter's two years at the pinnacle of German finance.
Just months into the job, the ambitious ex-investment banker was designing a bold merger with the London Stock Exchange to create a global titan in the industry.
In the end, the merger failed, costing shareholders tens of millions of euros in advisory and legal fees.
Kengeter had also irked local politicians because he had agreed to the merged company's headquarters being in London, rather than Frankfurt, a decision then made more complicated by Britain's vote to leave the European Union.
"He failed be convince in the end on the merger because he didn't recognise the forces at work," said Klaus Nieding of shareholder lobby group DSW. "In my opinion, he underestimated the authority of the government and exchange supervisors."
Kengeter's more direct undoing was the 4.5 million euros ($5.3 million) in shares he purchased two months before the announcement of formal merger talks, a boon to the share price that later aroused suspicions of insider trading.
Investigators raided his office and home on Feb. 1, and he has been under investigation ever since. All along, Kengeter and Deutsche Boerse have denied wrongdoing. Kengeter said he bought the shares through an official executive compensation programme.
Kengeter said on Thursday he still had many plans for the company, which he will continue to lead until a transition plan is in place, but was now "paving the way for a new beginning for Deutsche Boerse".
Some shareholders had been irate they would have to foot the bill for a 10.5 million euro deal to settle the insider trading probe - a deal a Frankfurt judge later declined to ratify.
Kengeter's decision to resign was "correct and proper", said Union Investment fund manager Ingo Speich.
The ongoing investigation had been damping staff morale.
"We can't recall that there has ever been such severe damage to reputation in the long history of our company," the group's works council said in an internal newsletter seen by Reuters.
Kengeter also left his last job under a cloud in 2013.
He had been the chief of UBS's investment bank during a time it lost $2.3 billion due to trades by rogue trader Kweku Adoboli. Kengeter was sidelined following a restructuring plan and eventually left.
($1 = 0.8552 euros)
(Reporting by Tom Sims; Editing by Mark Potter)