A UBS AG unit will pay $5.2 million in a settlement with Puerto Rico's financial institutions regulator over the firm's practices involving sales of Puerto Rico closed-end bond funds whose values later plunged.

UBS Financial Services Inc of Puerto Rico has agreed to pay $1.7 million in restitution to 34 Puerto Rico residents who invested in the funds and an additional $3.5 million to an investor education fund, according to a statement from Puerto Rico's Office of the Commissioner of Financial Institutions on Oct. 9.

The firm will also have to beef up its supervision of six brokers who Puerto Rico financial regulators found may have directed their clients to improperly borrow money in order to buy the funds, according to the settlement between UBS and Puerto Rico financial regulators, also on Oct. 9.

The loans, sold through UBS Bank USA of Utah, were not supposed to be used to buy securities. The UBS brokers, who were not identified in the settlement, may have recommended and traded positions in the closed-end funds that were too large, given the clients' liquid assets, risk tolerance and "more modest financial profile," according to the settlement.

UBS did not admit to any wrongdoing, negligence or mismanagement under the terms of the deal. A UBS spokesman said the firm is pleased to have resolved the matter with Puerto Rico's financial institutions regulator and looks forward to serving clients there.

Legal headaches have been mounting for UBS following a sharp decline in the value of Puerto Rico municipal bonds last year that resulted in big losses for investors in closed-end funds with heavy exposure to those bonds. The losses have sparked lawsuits and more than 500 securities arbitration cases against the firm. U.S. authorities launched a criminal fraud investigation in June over possible lending rule violations.

The Oct. 9 settlement stems from a "routine examination" that Puerto Rico financial regulators launched last year, covering the UBS unit's activity from June 2010 to September 2013. Regulators developed their findings based partly on interviews with a sampling of UBS clients who were elderly with low net worth and conservative investment goals.

UBS must increase its supervision of the six brokers involved for six months. Regulators did not identify the brokers in the settlement because it does not plan to take action against them and UBS did not admit to wrongdoing, Rafael Blanco, Puerto Rico's commissioner of financial institutions, said in an interview on Tuesday.

Rafael's office had initially identified nine brokers, but three have since left UBS, he said.