A unit of asset manager Legg Mason will pay more than $21 million to settle with the U.S. government a pair of civil cases that accused the company of hiding losses from investors in their retirement accounts and making certain trades that favored some clients over others.

The Securities and Exchange Commission and the U.S. Department of Labor jointly announced the settlement on Monday with the Legg Mason unit, Western Asset Management Co.