The top internal watchdog at the troubled Homeland Security Department has stepped down amid questions over his handling of a string of investigations involving department personnel and the management of his own office.

Charles Edwards was serving as acting director of the inspector general’s office at Homeland Security when he became embroiled in controversy. Members of Congress accused him of impeding an investigation into mistakes by the Secret Service, and he was leading a politically sensitive probe into accusations of wrongdoing and political favoritism by Alejandro Mayorkas, whom President Obama nominated to be the agency’s deputy director.

Mr. Edwards was to testify before Congress on Thursday to discuss his record, but the hearing was canceled upon news that he had asked to leave his post for an assignment in the department’s science and technology office.

Sen. Claire McCaskill, the Missouri Democrat who heads the Homeland Security and Governmental Affairs subcommittee on financial and contracting oversight, and Sen. Ron Johnson of Wisconsin, the subcommittee’s ranking Republican, said in a joint statement that they hoped Mr. Edwards‘ departure would “pave the way for a new level of accountability and transparency” within the inspector general’s office.

“Inspectors general are supposed to serve as the eyes and ears of taxpayers within our agencies, guarding against waste, fraud and abuse of power, and we expect them to abide by the same high standards of behavior they apply to agency officials,” the lawmakers said.

Ms. McCaskill and Mr. Johnson accused Mr. Edwards of delaying investigations into Secret Service agents who hired prostitutes in a well-publicized incident ahead of a visit by President Obama to Colombia last year.

Eighteen months after the incident, the senators said, Mr. Edwards still had not released much information from his investigation. They expressed concerns that he was stifling findings of wrongdoings in order to curry favor with Homeland Security leadership.

Mr. Edwards was the second-highest official at the inspector general’s office and acting director, but he requested a transfer to another position last week, Homeland Security officials said.

A representative for the inspector general’s office confirmed that Mr. Edwards had resigned, but declined to comment further other than to say that Carlton Mann, assistant inspector general, would become acting director.

Mr. Edwards had been leading a probe of Mr. Mayorkas, the department’s Citizenship and Immigration Services director at the sprawling domestic security agency. Mr. Mayorkas‘ nomination to Homeland Security’s No. 2 position has come into question as a result of charges of leveraging influence to obtain expedited visas for foreign investors.

Republican senators on the Homeland Security and Governmental Affairs Committee unanimously voted “present” late last week at Mr. Mayorkas‘ confirmation hearing, a sign of protest that Democrats were advancing the nomination even as the inspector general’s investigation was still underway. The majority of Democrats nevertheless sent the nomination to the full Senate, which has yet to vote on Mr. Mayorkas.

The inspector general’s representative did not say whether Mr. Edwards‘ departure would affect the investigation into Mr. Mayorkas.

Mr. Edwards also has faced allegations of nepotism. Ms. McCaskill and Mr. Johnson said they have received numerous complaints that Mr. Edwards hired his wife to a position in the inspector general’s office, then let her telecommute from India for seven months. The senators said several federal workers also accused Mr. Edwards of taking retaliatory action against employees who complained about the arrangement.

In July, Mr. Edwards issued a statement denying any wrongdoing, adding that the charges could undermine the work his office was doing.

“I am very disturbed that false allegations have been made against me, but more importantly, I am very concerned that this matter may negatively impact the important oversight work of the Office of Inspector General,” he said.

Cause of Action, a nonpartisan government accountability watchdog, has been investigating Mr. Edwards and sued the government to release records on his travel and complaints from department employees. In July, the group petitioned Mr. Obama to remove Mr. Edwards from office.

“Cause of Action sees the failure of the administration to hold Edwards accountable and Edwards‘ resignation, less than three days before a Senate hearing, as a cowardly excuse to avoid answering difficult questions about allegations of his abuse and misconduct, some of which may rise to violations of the law, in the Inspector General office,” said a statement from the group’s executive director, Dan Epstein.

Each department in the federal government has an inspector general’s office, a watchdog that is supposed to remain independent of the agency leadership. But the nature of the inspector general’s work — finding mistakes and mismanagement and correcting wrongdoing — had some members of Congress worried that, at least in Homeland Security’s case, people were pressuring the investigators to hide missteps in order to make the agency look better.

“I’m concerned because I think we’ve seen what I would believe is improper contact between the inspector general and the general counsel’s office of Homeland Security,” Mr. Johnson said this year. “I’m trying to figure out what that wall of separation really ought to be to maintain the independence of the inspector general.”

Mr. Obama has nominated John Roth, a top investigator at the Food and Drug Administration, to be the department’s inspector general, but the nomination has not been confirmed.