Attorney General William Barr discussing the counting of citizens in the country and the legal issues surrounding that effort, behind him stands Secretary of Commerce Wilbur Ross, in the Rose Garden at the White House.

The Justice Department will not bring charges against Attorney General William Barr and Commerce Secretary Wilbur Ross after the House voted last week to hold them in criminal contempt.

The DOJ had not been expected to pursue charges against Barr, who oversees the department, or Ross.

"The Department of Justice's long-standing position is that we will not prosecute an official for contempt of Congress for declining to provide information subject to a presidential assertion of executive privilege," Deputy Attorney General Jeffrey Rosen said in a letter to Speaker of the House Nancy Pelosi on Wednesday.

The House Oversight and Government Reform Committee had authorized subpoenas to the Justice and Commerce departments in April demanding information about the administration's attempt to put a citizenship question on the 2020 census.

Barr and Ross had refused to comply with the subpoenas, after Trump asserted executive privilege over the documents. The refusal to comply prompted the Oversight Committee to vote along party lines to hold the officials in contempt. That vote was sent to the entire Democrat-led House, which voted last month to hold the men in contempt.

After a defeat at the Supreme Court, Trump abandoned his fight to add the citizenship question to the census, opting instead to sign an executive order to collect citizenship information from government agencies.

Rosen contended in the letter that the Justice Department has "consistently adhered to the position that 'the contempt of Congress statute was not intended to apply and could not constitutionally be applied to an Executive Branch official who asserts the President's claim of executive privilege.'"

He cited multiple examples of the department taking the same stance during the Bush and Obama administrations.

"The Department has determined that the responses by the Attorney General and the Secretary of Commerce to the subpoenas issued by the Committee on Oversight and Reform did not constitute a crime," Rosen wrote.

A spokeswoman for the Oversight Committee did not immediately respond to CNBC's request for comment.