Musk’s U-turn on Twitter has investors like billionaire Carl Icahn laughing all the way to the bank

Icahn reportedly acquired a roughly $500 million stake in the mid-$30-a-share range.

Icahn reportedly made roughly $250 million after the run up in the company’s stock. Heidi Gutman—NBCUniversal/Getty Images

Sign up for the Fortune Features email list so you don’t miss our biggest features, exclusive interviews, and investigations.

Elon Musk’s decision to revive his $44 billion buyout of Twitter Inc. is shockingly good news for investors including billionaire Carl Icahn who continued to bet on the outcome of the deal through months of uncertainty.

After Musk and Twitter agreed to proceed with the deal at the original offer price at $54.20 a share on Tuesday, the social media company’s stock rallied as much as 23%, pushing the spread to its narrowest level since the pair entered a merger pact back in April. Shares of the company slipped 0.4% in premarket trading on Wednesday.

Subscribe to unlock this article and get full access to Fortune.com

Elon Musk’s decision to revive his $44 billion buyout of Twitter Inc. is shockingly good news for investors including billionaire Carl Icahn who continued to bet on the outcome of the deal through months of uncertainty.

After Musk and Twitter agreed to proceed with the deal at the original offer price at $54.20 a share on Tuesday, the social media company’s stock rallied as much as 23%, pushing the spread to its narrowest level since the pair entered a merger pact back in April. Shares of the company slipped 0.4% in premarket trading on Wednesday.

Tuesday was a “great day for arbs,” said Julian Klymochko, chief executive officer of Accelerate Financial Technologies. The saga closing in Twitter’s favor demonstrates the strength of definitive merger agreements and contract law, said Klymochko, who runs a merger-arbitrage investment fund.

Arbitrage traders make money by betting on merger agreements, with the potential for millions of dollars in profits if the deals go through. Now, all that’s left is to wait for the agreement to close. 

Icahn capitalized on the dispute, according to people familiar with the matter. He acquired a roughly $500 million stake in the mid-$30-a-share range, the people said, asking not to be identified because the matter is private. 

The veteran investor purchased the stake under the belief that Musk wouldn’t be able to get out of the deal, and the assumption that the value of the stock was in the range of roughly the mid-$30s a share, making the downside risk if Musk won the trial minimal, they added.

As a result, Icahn made roughly $250 million after the run up in the company’s stock. A representative for Icahn declined to comment. His stake was reported earlier by the Wall Street Journal.

The contentious deal has sent Twitter’s stock on a rollercoaster ride in recent months. It surged as high as $54.57 in April as the deal appeared to be moving to closure, and as low as $32.52 in July after Musk sent a termination letter in an attempt to back away from the buyout proposal. The stock rebounded again last month as a judge heard arguments in Twitter’s lawsuit aimed at forcing Musk to complete the transaction.

“For arb traders, it’s overall a good outcome,” said Aaron Glick, a merger arbitrage specialist at Cowen & Co., which makes markets and is long common stock and equity options in Twitter.