President Trump, three of his children and his real-estate businesses on Monday filed a federal lawsuit to block Deutsche Bank AG and Capital One Financial Corp. from complying with congressional subpoenas for documents related to him and his family.

In a lawsuit filed in U.S. District Court in Manhattan, lawyers for the president and his companies said the subpoenas—issued by the House Intelligence and Financial Services Committees—were intended to “harass” the president and to “rummage through every aspect of his personal finances, his businesses, and the private information of the president and his family, and to ferret about for any material that might be used to cause him political damage.”

Deutsche Bank, Germany’s largest lender, has for decades had a relationship with Mr. Trump and his businesses and has been the president’s primary bank. Since 1998, the bank has led or participated in loans of at least $2.5 billion to companies affiliated with Mr. Trump, The Wall Street Journal has reported.

Public disclosures during his candidacy showed borrowings from Deutsche Bank of more than $300 million by entities affiliated with Mr. Trump, including two 2012 mortgages—one valued at more than $50 million and the other at between $5 million and $25 million—for the Trump National Doral Miami, a Florida golf resort.

Deutsche Bank records have been of particular interest to Democratic lawmakers seeking to examine Mr. Trump’s finances, given the bank’s long ties to him.