Wells Fargo & Co. has agreed to pay $7.4 million to settle a class action claim that it unlawfully made brokers who left the firm forfeit bonuses that were deferred as part of their retirement plans, court documents show.

The deal comes more than a year after two former brokers for Wells Fargo Advisors LLC sued the firm in a class action lawsuit filed in the U.S. District Court for the Northern District of California. The brokers, Kennison Wakefield and William Stonhaus, challenged a provision of the firm's compensation plan that required them to forfeit certain deferred bonuses if they left Wells to work for competitors.

The brokers, who said they had earned the bonuses by meeting performance goals set by Wells, alleged the forfeiture requirement violated California and North Dakota state laws, according to court documents filed on Nov. 13.

Spokesmen for Wells Fargo could not be immediately reached for comment. Wells Fargo has not imposed the forfeiture policy for its California and North Dakota brokers since 2012 and does not plan to do so, according to the settlement document.

Wakefield left Wells in 2011 and now works for Morgan Stanley, according to regulatory document. Stonhaus joined a unit of UBS AG in 2008. A lawyer for the plaintiffs declined to comment.

About 135 brokers in California and North Dakota could share in a $5.6 million fund under terms of the proposed deal, which is subject to court approval. The remaining sum, nearly $1.9 million, will cover legal fees and expenses.

A hearing about the settlement is set for Dec. 18.