In the weeks after President Trump named Elon Musk and Vivek Ramaswamy to lead the so-called Department of Government Efficiency, the two men and their allies developed a frosty relationship. Just as Mr. Trump was inaugurated last January, Mr. Ramaswamy left the initiative, aimed at downsizing the federal work force, before it began, and Mr. Musk took charge.
But they seem to have buried the hatchet: Mr. Musk, the world’s richest person, donated $5 million in May to back Mr. Ramaswamy’s bid to be governor of Ohio, according to a campaign-finance filing made public on Wednesday.
The donation is another sign of Mr. Musk’s engagement in the midterm elections despite his apparent disillusionment with Republican politics over the past couple of years. He has now spent at least $90 million this election cycle, becoming one of its largest donors.
His biggest bet this year was on Nate Morris, a Senate candidate in Kentucky, who dropped out of the primary race after a Musk-backed super PAC spent $10 million to help him.
Mr. Musk has also funded his own super PAC, America PAC, which has taken on a lower profile since spending heavily in a failed effort to elect a conservative judge to Wisconsin’s top court last year. And he has donated millions to super PACs backing Republican candidates for the Senate and the House, as well as to Mr. Trump’s super PAC, MAGA Inc.
Mr. Musk posted on X last February that Mr. Ramaswamy had his “full endorsement” in his bid for Ohio governor, but Mr. Musk had not yet donated to support Mr. Ramaswamy’s campaign.
The newly disclosed donation went to a super PAC backing Mr. Ramaswamy’s bid, V-PAC. That group has also drawn $20 million in support from the hedge fund investor Jeff Yass, one of the few conservative megadonors whose political giving is close to matching Mr. Musk’s. Another $1 million came from the hedge fund investor Bill Ackman in June.
Mr. Ramaswamy is set to square off in November against Amy Acton, a Democratic former state health official, in what is expected to be one of the country’s most competitive races for governor. A wealthy entrepreneur himself, Mr. Ramaswamy put $25 million of his own money into his bid, giving him a sizable financial advantage in a state that has become solidly red in recent elections.
Mr. Ramaswamy’s support from Mr. Musk was never guaranteed. Their fractious relationship during the presidential transition was rooted in different philosophies about how to best reduce the deficit. Mr. Ramaswamy dreamed of achieving cuts through deregulation. But Mr. Musk had a more drastic vision, focusing on tearing down entire agencies.
There were also personal differences between the two men: Last January, The New York Times reported that Mr. Musk had been sharply critical of Mr. Ramaswamy in private conversations.

