WASHINGTON — A senior official at the Department of Homeland Security resigned on Saturday after accusations that she had created a sexualized office culture that was hostile to men. The official, Suzanne Barr, is a longtime aide to the department’s secretary, Janet Napolitano, and had been on leave from her position as chief of staff to the director of Immigration and Customs Enforcement because of the allegations.

In a letter to the ICE director, John Morton, that was obtained by The New York Times, Ms. Barr denied the accusations as “unfounded and without any merit,” but said she had decided to move on.

“In recent weeks, I have been the focus of unfounded allegations designed to destroy my reputation, but of greater concern, however, is the threat these allegations represent to the reputation of this agency and the men and women who proudly serve their country by advancing ICE’s mission,” she wrote. “As such, I feel it is incumbent upon me to take every step necessary to prevent further harm to the agency and to prevent this from further distracting from our critical work. Therefore, it is with great regret that I submit my resignation as chief of staff for Immigration and Customs Enforcement.”

The accusations against Ms. Barr came to light as part of a discrimination lawsuit filed by James T. Hayes Jr., a top federal immigration official in New York, against Ms. Napolitano, contending that he had been pushed out of a senior management position to make room for a less-qualified woman and then was retaliated against when he threatened to sue. The lawsuit also accused Ms. Barr of creating “a frat-house-type atmosphere that is targeted to humiliate and intimidate male employees.”