US president Donald Trump has offered a partial denial in public over his racist remarks disparaging Haitians and African countries – but privately defended them, according to an insider.

Trump said he was only expressing what many people think, but will not say, about immigrants from economically depressed countries, according to a source who spoke to the president as the controversy unfolded.

He spent Thursday evening making a flurry of calls to friends and outside advisers to judge their reaction to the tempest, according to the insider.

Trump was not apologetic about his inflammatory remarks and denied he was racist, and instead blamed the media for distorting his meaning, according to his confidant.

Critics of the president, including some in his own Republican Party, attacked the vulgar comments he made behind closed doors.

In his meeting with a group of senators, Trump had questioned why the US would accept more immigrants from Haiti and "shithole countries" in Africa as he rejected a bipartisan immigration deal, according to one participant and others who had been briefed on the Oval Office conversation.

The comments gave further credence to charges that the president is racist, and rocked immigration talks that were already on a tenuous footing.

In a series of tweets, Trump said: "The language used by me at the DACA [Deferred Action for Childhood Arrivals] meeting was tough, but this was not the language used".

However, his advisers notably did not dispute the most controversial of his reported remarks: using the word "shithole" to describe African nations, and saying he would prefer immigrants from countries like Norway instead.

Senator Dick Durbin of Illinois, the only Democrat in the room, said Trump had indeed said what he was reported to have said.

The remarks, Durbin said, were "vile, hate-filled and clearly racial in their content".

He said Trump used the most vulgar term "more than once".

"If that's not racism, I don't know how you can define it," Florida representative Ileana Ros-Lehtinen, a Republican, told a TV station in Miami.

Republican senator Jeff Flake of Arizona tweeted: "The words used by the president, as related to me directly following the meeting by those in attendance, were not 'tough', they were abhorrent and repulsive."

Democratic senator Dianne Feinstein called the comments "beneath the dignity of the presidency" and said Trump's desire to see more immigrants from countries like Norway was "an effort to set this country back generations by promoting a homogeneous, white society".

Republican leaders were largely silent, although House Speaker Paul Ryan said the vulgar language was "very unfortunate, unhelpful".

Trump's insults – along with his rejection of the bipartisan immigration deal drafted by six senators – also threatened to further complicate efforts to extend protections for hundreds of thousands of young immigrants, many of whom were brought to the US as children and remain there illegally.

Trump last year ended the Deferred Action for Childhood Arrivals scheme, which provided protection from deportation along with the ability to work legally in the US. He gave Congress until March to come up with a legislative solution.

The three Democratic and three Republican senators who had struck their proposed deal had been working for months on how to balance those protections with Trump's demands for border security, an end to a visa lottery aimed at increasing immigrant diversity, and limits to immigrants' ability to sponsor family members to join them in America.

It is unclear now how a deal might emerge, and failure could lead to a US government shutdown.

Senior congressman Mike Simpson said: "The rhetoric just makes it more difficult, and that's unfortunate.

"I don't think it makes it impossible, but I suspect the Democrats are sitting there going: 'Why would we want to compromise with him on anything?'"

Legislators have until January 19 to approve a government-wide stopgap spending bill, and Republicans will need Democratic votes to push the measure through. But some Democrats have threatened to withhold support unless an immigration pact is forged.

Trump's comments came as Durbin was presenting details of the compromise plan that included providing $1.6 billion (£1.2bn) for the first instalment of the president's long-sought border wall.

Trump took particular issue with the idea that people who had fled to the US after disasters hit their homes in places such as El Salvador, Guatemala and Haiti would be allowed to stay as part of the deal.

When it came to talk of extending protections for Haitians, Durbin said the president replied: "We don't need more Haitians."

"He said: 'Put me down for wanting more Europeans to come to this country. Why don't we get more people from Norway?'" Durbin told reporters in Chicago.

Trump insisted that he "never said anything derogatory about Haitians other than Haiti is, obviously, a very poor and troubled country. Never said 'take them out.' Made up by Dems."

And he wrote: "I have a wonderful relationship with Haitians. Probably should record future meetings – unfortunately, no trust!"