WASHINGTON- The U.S. Supreme Court on Wednesday made it easier for President Joe Biden to remove the head of the federal housing finance agency while also nixing separate claims brought by shareholders of mortgage finance companies Fannie Mae and Freddie Mac.

The court upheld part of a lower court ruling that the Federal Housing Finance Agency's structure is unconstitutional under the separation of powers doctrine because the agency's lone director is insufficiently accountable to the president.

But the justices faulted the lower court for allowing the shareholders to pursue separate litigation challenging a 2012 agreement between the FHFA and the Treasury Department arising from the government's rescue of the mortgage finance firms following the 2008 housing crisis.

The court sent the case back to lower courts on whether the shareholders can obtain relief based on their constitutional claims.

The FHFA is led by a single director who until Wednesday's ruling could be removed by the president only "for cause."

The Supreme Court ruling, in line with a similar decision last year concerning the Consumer Financial Protection Bureau, will give Biden and future presidents the authority to remove the head of the agency at any time. The FHFA's current director is Mark Calabria, who was appointed to the post by former President Donald Trump, and the ruling would make it easier for Biden to remove him if he chooses to do so.

The 2012 agreement eliminated dividend payouts to various shareholders and required Fannie and Freddie to pay the U.S. Treasury an amount equal to their quarterly net worth each quarter, which now totals billions of dollars.

(Reporting by Lawrence Hurley; Editing by Will Dunham) ((lawrence.hurley@thomsonreuters.com; Twitter: @lawrencehurley; +1 202-809-3080))