Homeland Security Secretary Kirstjen Nielsen testifies during a hearing held by the Senate Judiciary Committee January 16, 2018 in Washington, DC. Sen. Patrick Leahy and Sen. RIchard Durbin Durbin both questioned Nielsen about derogatory language reportedly used by U.S. President Donald Trump during a meeting last week on immigration. Nielsen said "I did not hear that word used", when asked about the word "shithole".
PHOTO: Win McNamee/Getty Images
Homeland Security Secretary Kirstjen Nielsen testifies during a hearing held by the Senate Judiciary Committee January 16, 2018 in Washington, DC. Sen. Patrick Leahy and Sen. RIchard Durbin Durbin both questioned Nielsen about derogatory language reportedly used by U.S. President Donald Trump during a meeting last week on immigration. Nielsen said "I did not hear that word used", when asked about the word "shithole".
Now playing
00:55
NYT: DHS secretary close to resigning
Pat Cipollone close up
PHOTO: Stein Mitchell Cipollone Beato & Missner LLP
Pat Cipollone close up
Now playing
02:10
Meet Trump's new White House counsel
John Bolton and John Kelly
PHOTO: Getty Images
John Bolton and John Kelly
Now playing
02:12
Bolton, Kelly get into heated shouting match
US President Donald Trump prepares to board Air Force One at Andrews Air Force Base in Maryland on October 1, 2018.
PHOTO: MANDEL NGAN/Getty Images
US President Donald Trump prepares to board Air Force One at Andrews Air Force Base in Maryland on October 1, 2018.
Now playing
02:35
Trump administration dismisses EPA scientists
Donald Trump welcomes retired United States Marine Corps general James Mattis as they pose for a photo before their meeting at Trump International Golf Club, November 19, 2016 in Bedminster Township, New Jersey.
PHOTO: Drew Angerer/Getty Images
Donald Trump welcomes retired United States Marine Corps general James Mattis as they pose for a photo before their meeting at Trump International Golf Club, November 19, 2016 in Bedminster Township, New Jersey.
Now playing
02:44
Trump: James Mattis is 'sort of a Democrat'
Now playing
01:27
Sanders: 'Sad' that op-ed is getting attention
Sonny Perdue, President TrumpÕs nominee to lead the Agriculture Department, takes his seat as he arrives for his confirmation hearing before the Senate Committee on Agriculture, Nutrition, and Forestry on Capitol Hill, March 23, 2017 in Washington. Previously, Perdue served as the governor of Gerogia from 2003 to 2011. (Photo by Drew Angerer/Getty Images)
Sonny Perdue, President TrumpÕs nominee to lead the Agriculture Department, takes his seat as he arrives for his confirmation hearing before the Senate Committee on Agriculture, Nutrition, and Forestry on Capitol Hill, March 23, 2017 in Washington. Previously, Perdue served as the governor of Gerogia from 2003 to 2011. (Photo by Drew Angerer/Getty Images)
Now playing
02:02
Emails reveal food lobbyist influence on USDA
US.President Donald Trump departs the White House July 31, 2018 in Washington, DC (Photo by Win McNamee/Getty Images)
PHOTO: Win McNamee/Getty Images
US.President Donald Trump departs the White House July 31, 2018 in Washington, DC (Photo by Win McNamee/Getty Images)
Now playing
02:03
Trump team suggests ACLU find deported parents
President Donald Trump speaks during a rally, Thursday, Aug. 2, 2018, at Mohegan Sun Arena at Casey Plaza in Wilkes Barre, Pa. (AP Photo/Matt Rourke)
PHOTO: Matt Rourke/AP
President Donald Trump speaks during a rally, Thursday, Aug. 2, 2018, at Mohegan Sun Arena at Casey Plaza in Wilkes Barre, Pa. (AP Photo/Matt Rourke)
Now playing
02:16
Trump slams probe 'hoax' despite intel warning
John Kelly answers questions during a press conference related to President Donald Trump
PHOTO: Drew Angerer/Getty Images
John Kelly answers questions during a press conference related to President Donald Trump's recent executive order concerning travel and refugees, January 31, 2017 in Washington, DC.
Now playing
00:57
Trump asked John Kelly to stay through 2020
US candidate to the head of International Organization for Migration (IOM) Ken Isaacs looks on during a press briefing on March 19, 2018 in Geneva.
PHOTO: Fabrice Coffrini/AFP/Getty Images
US candidate to the head of International Organization for Migration (IOM) Ken Isaacs looks on during a press briefing on March 19, 2018 in Geneva.
Now playing
00:32
Trump's pick for UN migration job voted down
PHOTO: Nicholas Kamm/AFP/Getty Images/File
Now playing
01:59
Trump appointee guts UN document on racism
Bill Shine, left, and President Donald Trump
PHOTO: Getty Images
Bill Shine, left, and President Donald Trump
Now playing
00:51
Former Fox News executive takes White House job
Vice President Mike Pence speaks at Las Vegas City Hall on October 7, 2017.
PHOTO: Ethan Miller/Getty
Vice President Mike Pence speaks at Las Vegas City Hall on October 7, 2017.
Now playing
02:34
Genealogist: Chain migration helped Pence family
PHOTO: getty images/dpa/ap
Now playing
02:57
Vets call on WH to fire aide over crude joke
White House Chief of Staff John Kelly awaits fthe start of a jobs creation pledge event in the East Room of the White House July 19, 2018 in Washington, DC. (BRENDAN SMIALOWSKI/AFP/Getty Images)
PHOTO: BRENDAN SMIALOWSKI/AFP/Getty Images
White House Chief of Staff John Kelly awaits fthe start of a jobs creation pledge event in the East Room of the White House July 19, 2018 in Washington, DC. (BRENDAN SMIALOWSKI/AFP/Getty Images)
Now playing
02:08
Kelly retracts comment Trump is 'embarrassed'
(CNN) —  

President Donald Trump and Homeland Security Secretary Kirstjen Nielsen got into a lengthy, heated argument during a Cabinet meeting focused on immigration Wednesday, a source with knowledge of the blowup told CNN.

Trump was furious with Nielsen, telling her he didn’t think she was doing enough to secure the border. But Nielsen stood her ground, citing the law in certain instances, the source said.

A separate White House official confirmed that Trump exploded over immigration in front of the Cabinet. The official described the remarks as “angry and heated” but also as fairly typical for Trump on this issue.

The New York Times first reported on the blowup, saying Trump berated Nielsen to the point she told colleagues she was close to resigning after the incident.

Two people told the Times that Nielsen, the Cabinet head who oversees agencies responsible for immigration enforcement and border security, drafted a resignation letter.

Trump went on a “lengthy tirade” before the full Cabinet, the report said, but it added that Nielsen thought the thrust of Trump’s remarks was about her.

A Department of Homeland Security spokesman flatly denied that Nielsen had threatened to resign.

“The @nytimes article alleging that the Secretary drafted a resignation letter yesterday and was close to resigning is false,” the spokesman, Tyler Houlton, tweeted. “The Secretary is hard at work today on the President’s security-focused agenda and supporting the men and women of @DHSgov.”

White House press secretary Sarah Sanders said in reaction to the report, “The President is committed to fixing our broken immigration system and our porous borders. We are a country of laws and the president and his administration will enforce them.”

Nielsen said in a statement that she shares Trump’s frustration about the border, blaming it in part on “congressional inaction.”

“The President is rightly frustrated that existing loopholes and the lack of congressional action have prevented this administration from fully securing the border and protecting the American people. I share his frustration,” Nielsen said. “Border security is the most basic and necessary responsibility of a sovereign nation. These are complex issues and I will continue to direct the Department to do all we can to implement the President’s security-focused agenda.”

The report of Trump’s angry remarks marked at least the second top Cabinet official Trump is said to have berated to the point they nearly quit. The Times reported last year that Trump called Attorney General Jeff Sessions an “idiot” to his face and said he should resign, and a source told CNN last year that Sessions offered to resign amid a series of heated exchanges with Trump.

Nielsen was picked to be secretary after her former boss at the department, John Kelly, was tapped to be Trump’s chief of staff.

Nielsen, who was Kelly’s chief of staff, largely picked up where he left off at the department, including serving as the face of the President’s aggressive immigration agenda. Trump and Kelly have also had an increasingly fraught relationship of late.

Nielsen has served as the primary voice of Trump’s immigration policy and has led the department in pursuing a number of hardline positions to crack down on illegal immigration and cut back on legal immigration. She has defended policies under criticism from Democrats in Congress, including a heated exchange with New Jersey’s Sen. Cory Booker after she said she did not hear the President’s comments in a meeting where he reportedly described immigrants coming from “shithole countries.”

In recent weeks, with increased attention on the southern border and a “caravan” of migrants seeking asylum in the United States, Nielsen has announced that her department will refer any immigrant caught crossing the border illegally for prosecution, even if they may be making a valid asylum claim, which could result in the separation of thousands of parents from their children as they face charges.