NEW YORK — New York City Mayor Bill de Blasio has ended his campaign for the 2020 Democratic presidential nomination.

De Blasio struggled to gain traction in a sprawling field of Democrats seeking the presidency. He announced his decision in an MSNBC interview on Friday.

De Blasio launched his bid in May, but his campaign largely failed to take off.

De Blasio says he feels he's contributed all he can "to this primary election." He tells MSNBC's "Morning Joe" show "it's clearly not my time."

The mayor had announced his presidential run by heading to the Statue of Liberty, where he said the country is in an "identity crisis" around immigration, which he called "the founding and unifying element of the American experience."

"We are figuring out who we are," he said then. "There are American values we need to return to and fight for in order to achieve our greatest potential."

RELATED: Who is running for president in 2020?

RELATED: 11 Democrats qualify for October debate so far

On his campaign's first day, he dived into an insult match with President Donald Trump.

The mayor failed to qualify for the September debate and was a longshot to qualify for the October debate. He thus far has failed to reach 2% in any one approved poll, let alone the four necessary to make the stage along with 130,000 individual donations.

De Blasio's exit leaves 19 still in the race for the Democratic nomination. 

Three Republicans are challenging president Trump for the GOP nomination, although some states have already signaled they will not hold primaries and lining up behind the president.