WASHINGTON — Before trading schoolyard taunts on Twitter, President Donald Trump and former New York City Mayor Michael Bloomberg once exchanged compliments, sharing a cordial working relationship that is providing the field of 2020 Democratic presidential hopefuls with fodder for new attacks.

As Trump has ramped up his attacks on Bloomberg amid the billionaire philanthropist’s surge in national polls, the field of Democratic presidential candidates have also intensified their efforts to cast Bloomberg as a one-time ally of Trump’s.

This past week, both Trump and Democrat Joe Biden, normally on opposing ends of any argument, seized on a 2011 video clip of Bloomberg describing Trump as a “New York Icon” during a Fox News interview. The Trump campaign touted the remarks on Twitter, while Biden used it in a Twitter campaign ad that flashed other pictures of Trump and Bloomberg together at events.

Bloomberg’s campaign has pushed back on the attempts to link the two New York moguls, arguing in part that as mayor, Bloomberg was merely building a working relationship with one of the city’s biggest developers. But Democratic campaign strategists say video clips of Bloomberg complimenting Trump in past interviews will continue to haunt Bloomberg unless he pushes back more forcefully on the comparisons to Trump.

“It’s a major problem for Bloomberg,” said Washington, D.C.-based Democratic campaign strategist Brad Bannon, who is not affiliated with any of the campaigns. “The other Democratic candidates will continue to exploit the relationship.”

During his three terms as mayor, Bloomberg twice accepted Trump’s invitation to appear on his reality TV show “The Apprentice.” In a 2004 episode, Bloomberg invited contestants to Gracie Mansion, the taxpayer funded mayoral residence, and in a 2008 episode, he weighed in as the contestants competed to sell the most hot dogs.

Get the Breaking News newsletter! Get the latest breaking news as it happens. By clicking Sign up, you agree to our privacy policy.

Trump, in media interviews, eagerly praised Bloomberg’s work as mayor following his 2001 election. In 2011, the Bloomberg administration granted a contract to The Trump Organization to operate and manage a Bronx golf course on public land that had taken the city decades to renovate.

At a 2012 ribbon cutting ceremony for the golf course, Bloomberg said that “If there is anybody who has changed this city, it is Donald Trump.” Trump called Bloomberg “a great mayor,” adding “this guy is fantastic.”

The goodwill tapered off in 2016 as Bloomberg actively campaigned against Trump’s presidential bid.

Bloomberg, who ran for mayor as a Republican before becoming an independent, skewered Trump in a prime-time speech at the 2016 Democratic National Convention, giving his full-throated endorsement to Trump’s rival Hillary Clinton.

Trump has since taken to firing off daily tweets disparaging Bloomberg’s height, while Bloomberg has dubbed Trump a “carnival-barking clown.”

John Catsimatidis, a billionaire businessman and radio political talk show host who knows both men, said the past relationship between both men was one of convenience.

“When you’re a developer, a builder, the mayor is king. No matter what you feel about the person, you always pay homage,” said Catsimatidis, a former Republican New York City mayoral hopeful.

Rep. Peter King (R-Seaford), who has ties to both Trump and Bloomberg, said, “There was never any major animosity between the two, but nothing very warm about their relationship either.”

King, a Trump ally on Capitol Hill who has also received campaign fundraising support from Bloomberg, said that while both are “alpha males” and “tough businessmen,” they also both hail from “different worlds.”

Trump, born in Queens, built his wealth with the backing of his developer father, while Bloomberg, raised in Massachusetts to a working class family, built his media empire by developing a computer software system widely used on Wall Street.

In the past week, Democrats have signaled they plan to continue making Bloomberg’s past relationship with Trump an issue.

Sen. Elizabeth Warren (D-Mass.) at Wednesday night’s debate likened Bloomberg to Trump throughout the night, saying, "Democrats take a huge risk if we just substitute one arrogant billionaire for another."

Sen. Bernie Sanders (I-Vt.) on Monday tweeted out an old photo of Bloomberg and Trump deep in conversation at a 2007 golf tournament to underscore their past relationship after Bloomberg’s campaign accused Sanders of being Trump’s “new bro.”

Bannon said that with most polls showing that “what Democrats are looking for in a candidate more than anything else is someone who can beat” Trump, Bloomberg must continue to make the case that he is “diametrically opposed to Trump’s policies.”

“When Elizabeth Warren is comparing Bloomberg to Trump, and making the point that you can’t beat Donald Trump with the Democratic version of Trump, that’s very problematic to him,” Bannon said. “The best way for Bloomberg to deal with that is to focus on the work he has done in the last few years on environmental issues and especially gun control, that show he may have made some comments in the past, but he has long been opposed to Trump’s policies.”