The Consumer Financial Protection Bureau, the "brainchild" of Sen. Elizabeth Warren (D-Mass.), was declared unconstitutional by a federal judge Thursday.

Here's what the ruling said

In the case CFPB v RD Legal Funding, Judge Loretta Preska said that not only is the structure of the CFPB unconstitutional, but that the only remedy is to dismantle the office.

Preska wrote that she sided with a previous finding by federal Judge Kavanaugh, saying "based on considerations of history, liberty, and presidential authority," the CFPB "is unconstitutionally structured because it is an independent agency that exercises substantial executive power and is headed by a single Director," quoting Kavanaugh.

Critics have said that the director of the CFPB was created in a way that undermined the oversight power of the executive branch, while defenders said it was necessary in order to maintain its independence. The CFPB consolidated several powers that had been dispersed among many different government agencies.

One of those critics, Sen. Ted Cruz (R-Texas), introduced legislation to dismantle the office in February 2017 because it had become an “out-of-control bureaucracy.”

President Donald Trump used his social media account to mock the agency and he promised to reform it.

"The Consumer Financial Protection Bureau, or CFPB, has been a total disaster as run by the previous Administrations pick.

"Financial Institutions have been devastated and unable to properly serve the public," he added. "We will bring it back to life!"

Here's a video from the Federalist Society explaining the CFPB:

The CFPB was created in 2011 after Warren advocated for it before she became a senator. She was passed over as its director, however, because of concerns from both Democrats and Republicans.

It was widely seen as one of the major accomplishments of the presidential hopeful for 2020.