The Senate voted along party lines to confirm Alejandro Mayorkas as the No. 2 official at the Department of Homeland Security Friday morning, after a vitriolic partisan debate that raged for months.

The 54-41 roll call vote occurred under new Senate rules that made it possible to confirm a presidential nominee with a simple majority instead of the 60 votes required previously.

Mayorkas, a former U.S. attorney from Los Angeles,  will now join the new Secretary of the Department,   Jeh Johnson ,who was confirmed earlier in the week.

Johnson received a majority of GOP votes. But the Mayorkas nomination drew concern from Republican senators since they learned that he was the subject of an ongoing inquiry by the DHS inspector general over allegations that he mismanaged the program and showed favoritism, charges Mayorkas emphatically rejected.

The inquiry will not be concluded until February leading Republicans to argue for a  a delay in the vote. They said  there was no Senate precedent for confirming a candidate under investigation.

Democrats pointed out that the DHS inspector general, Charles Edwards,  was himself under investigation on unrelated charges of favoritism and mismanagement. Edwards   resigned this week. Before doing so, he told Senate staff there had so far been no finding of criminal wrongdoing in the ongoing inquiry of Mayorkas. Still, internal reports by his staff showed serious problems in the visa program that Mayorkas regulates as director of the United States Citizenship and Immigration Service.

One of those reports, due to be released Monday, was cited by Republicans in the final hours of the debate. A copy, obtained by the Washington Post, alleges serious potential national security and fraud risks in the visa program, Mayorkas has administered for the past four and a half years. The program allows investors to enter the U.S. if they agree to invest at least $500,000 to create American job, Democrats said the soon-t--be-released audit report was outdated and failed to note Mayorkas' efforts to fix problems in the program.

The nomination of Mayorkas  drew strong disagreement even among usually friendly lawmakers. Senate Homeland Security and Government Affairs Committee chairman, Tom Carper, a Delaware Democrat, led the push for Mayorkas confirmation. He argued that Mayorkas had a stellar record, was backed by bi-partisan experts in national security, and was being treated unfairly by a politicized inquiry.

The ranking member of the Homeland Security panel, Sen. Tom Coburn of Oklahoma, disagreed, arguing in committee and on the Senate floor that it was inappropriate for the Senate to proceed given the ongoing inquiry. He also cited concerns raised by investigators about national security and fraud problems in the visa program. Coburn said in an interview this week  that 18 members of the inspector general’s staff are continuing to work on the Mayorkas review, which will likely be completed by February. Coburn urged a delay to consider the IG reports. During the debate Thursday night, Carper said it was time for a strong leadership team to be confirmed at DHS.  “We have waited long enough,” he said.