Homeland Security Secretary Kristjen Nielsen got an earful from President Donald Trump over border security during a recent Cabinet meeting,  sources told CNN.

Trump was apparently not satisfied that Nielsen was doing enough to secure the border, but Nielsen defended her department, saying that it was operating within the law. 

The New York Times reported that the tongue lashing was so severe that Nielsen told colleagues that she was close to resigning from her post after the incident. Nielsen reportedly went so far as to draft a resignation letter. 

Administration officials took to Twitter to deny the reports. 

TheStreet Recommends

"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 in a recent statement.

"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."