(CNN) President Donald Trump announced Thursday he has canceled a planned trip to Switzerland to attend the World Economy Forum in Davos, hours after saying the trip was still on.

"Because of the Democrats intransigence on Border Security and the great importance of Safety for our Nation, I am respectfully cancelling my very important trip to Davos, Switzerland for the World Economic Forum," he wrote. "My warmest regards and apologies to the @WEF!"

Trump was due to depart for the mountainside conference in two weeks. He was to be accompanied by a large delegation of Cabinet officials.

Earlier in the day, Trump said the trip was still happening, but would be canceled if an extended partial government shutdown was still in effect.

"I intended to go and speak in front of the world financial community in Davos. That's still on. But if the shutdown continues -- which is in a while from now. But if the shutdown continues, I won't go," he said.

Read More