City Comptroller John Liu shelled out $346,000 for his mayoral campaign this quarter but spent close to 20 percent of those funds on lawyers.

The embattled politician — whose top fund-raiser, Oliver Pan, and treasurer, Jenny Hou, were accused of funneling illegal contributions to his campaign war chest — paid more than $71,000 in legal fees, according to his most recent campaign-finance filing.

Liu’s expenses included $50,000 to the law firm Zuckerman Spaeder LLP and $7,740.58 for legal services to Lankler Carragher & Horwitz LLP.