Millionaire real estate executive Paul Massey announced he is dropping out of the race for mayor on Wednesday.

In an email to his supporters, the 58-year-old Republican candidate said the cost of running for office was “extraordinary.”

“...I do not see a path to raising the necessary funds to beat an incumbent mayor,” Massey said in the statement. “I am forever indebted to my family, team and my friends for their support.”

Massey announced his run for mayor in August 2016, but struggled to gain attention despite expenditures of millions of dollars. A Quinnipiac University poll in May 2017 said Mayor Bill de Blasio would beat him by a margin of 63 percent to 21 percent.

Massey, who established residency in the city only recently from Westchester, had attacked de Blasio’s stewardship of the city, citing issues including crime, quality of life, homelessness and taxes.

In his announcement Wednesday, Massey said he was “proud” to have contributed to the debate on education, housing and homelessness.

Just last week, he unveiled an infrastructure overhaul plan that included a proposal to mitigate the L train shutdown with a G train extension. The MTA, however, shot the idea down, saying it was “not feasible.”

“This journey has been wonderful because of the great New Yorkers I’ve met and all of the things my team and I have learned,” he said. “As I have in the past, I intend to involve myself in community and not-for-profit organizations in New York City, especially in education, which is my passion. New York certainly hasn’t heard the last from me.”

With Massey out, the front-runner for the GOP nomination is Nicole Malliotakis, a Republican assemblywoman from Staten Island.

Malliotakis in a statement called Massey a “gentleman,” and said she was “sad” he’s dropping out.

“Today’s decision by Paul Massey clears the field in the race for mayor,” Malliotakis said. “I will now be able to focus all my energies on defeating Bill de Blasio in the November election.”

Hours earlier, Massey and Malliotakis had faced off at a debate in midtown sponsored by Crain’s New York Business.

Massey launched his real estate firm, Massey Knakal Realty, in 1988 before selling it to Cushman & Wakefield three years ago. He then became the president of New York investment sales at Cushman & Wakefield.

With Lauren Cook