White House chief of staff John Kelly said Thursday that President Trump was correct when he tweeted in the morning that federal officials and the military will not be in Puerto Rico "forever."

Trump's tweet was criticized by Democrats and the press as a sign that Trump was about to pull federal resources from the hurricane recovery effort on the U.S. island territory.

But Kelly said at a White House press briefing that the goal of federal first responders is to get Puerto Rico back up on its feet as quickly as possible, and then leave.

"I think he said the U.S. military and FEMA can't be there forever, right?" Kelly asked reporters.

"First responders," he continued. "The minute you go anywhere as a first responder, and this would apply certainly to the military, you are trying very hard, working very hard to work yourself out of a job."

"Our country will stand with those American citizens in Puerto Rico until the job is done, but the tweet about FEMA and DOD... is exactly accurate," he added. "They're not going to be there forever, and the whole point is to start to work yourself out of a job and transition to the rebuilding process."

Trump tweeted Thursday morning, "We cannot keep FEMA, the Military & the First Responders, who have been amazing (under the most difficult circumstances) in P.R. forever!"

Kelly said he had just spoken with Puerto Rico Gov. Ricardo Rossello, and said the Trump administration has a "great relationship" with him.

Related: Trump angers Puerto Rico's politicians for saying federal aid will eventually end

"Our country will stand with those American citizens in Puerto Rico until the job is done, but the tweet about FEMA and DOD... is exactly accurate. They're not going to be there forever, and the whole point is to start to work yourself out of a job and transition to the rebuilding process."