WASHINGTON, May 16 (Reuters) - The Dow topped 40,000 for the first time on Thursday in an all-time high, giving U.S. President Joe Biden an opening to prove his Republican election rival's 2020 predictions wrong.

The state of the U.S. economy looms as one of the larger factors weighing on the Democratic president's bid for reelection. Persistently high prices have hindered Biden's efforts to win credit from voters for his handling of the economy, although inflation in recent months has been easing.

"Good one, Donald," Biden said in a post on X hours after the blue-chip index made its gains.

In an accompanying video, a split screen shows Donald Trump campaigning in the 2020 presidential election he lost to the Democrat.

"If Biden wins, you're going to have a stock market collapse the likes of which you've never had," Trump says in the video clip.

The top half of the screen shows the year 2024 and images of Biden and Vice President Kamala Harris, with commentary from an array of business television newscasters on the 40,000 breach.

"The Dow 30 broke 40,000 for the first time in history," one broadcaster says.

"Look at that market!" exclaims a second.

"We see earnings increasing for the second quarter. We see record earnings estimates for the third and fourth quarter and that's what really impresses me," another intones.

The video ends with Fox Business Network's Stuart Varney saying, "I've been doing this a long time. I never expected the Dow to hit 40,000."

The Trump campaign did not immediately respond to a request for comment.

Biden has struggled to convince voters of the efficacy of his economic policies despite a backdrop of low unemployment and above-trend economic growth. A Reuters/Ipsos poll last month showed Trump had a 7 percentage-point edge over Biden on the economy. (Reporting by Doina Chiacu; editing by Jonathan Oatis)