Michael Cohen, the former personal attorney of President Donald Trump, departs the U.S. Capitol after testifying before a closed House Intelligence Committee hearing on Capitol Hill in Washington, February 28, 2019.

Federal prosecutors in New York have ended their campaign finance investigation into hush money payments arranged by President Donald Trump's former lawyer Michael Cohen to two women who claim they had sex with Trump, a judge revealed Wednesday.

U.S. District Judge William Pauley also ordered Wednesday that materials related to the probe of Cohen and those payments should be unsealed — and denied a request by prosecutors to keep certain portions blacked out.

Pauley ordered that related materials and a recent status report from the prosecutors, which are currently sealed from public view, be made public in U.S. District Court in Manhattan at 11 a.m. ET Thursday.

While prosecutors in the U.S. Attorney's Office for the Southern District of New York agreed that the "majority of the campaign finance portions of the Materials may be unsealed," they wanted some portions of the materials kept hidden, according to the judge.

But Pauley refused.

"The campaign finance violations discussed in the Materials are a matter of national importance," Pauley wrote.

"Now that the Government's investigation into those violations has concluded, it is time that every American has an opportunity to scrutinize the Materials."

FBI agents raided Cohen's apartment, hotel room and office in April 2018, collecting troves of records and electronic devices. Some of those materials were made public with redacted portions in March 2019.

It was not clear if the move by prosecutors to end the campaign finance probe of Cohen meant that no other charges would be lodged in connection with the hush money payments.

A Justice Department spokeswoman declined to comment.

Cohen, 52, is serving a three-year prison sentence after pleading guilty last year to crimes that included facilitating the hush money payments to porn star Stormy Daniels and Playboy model Karen McDougal, as well as other financial crimes, and lying to Congress.

He personally paid Daniels $130,000 on the eve of the 2016 presidential election in exchange for her agreement to keep quiet about her alleged tryst with Trump a decade earlier, on the heels of his wife Melania giving birth to their son.

Cohen also arranged for the publisher of the supermarket tabloid The National Enquirer to pay McDougal $150,000 in the months leading up to the election. McDougal claims she had an affair with Trump.

The president has denied having sex with either Daniels or McDougal.

The disgraced and now-disbarred lawyer Cohen has said he arranged both payments at the behest of Trump in order to avoid a public scandal that could harm his chances of winning the election against Democrat Hillary Clinton.