NASHUA, New Hampshire — A company that owns and operates offices and apartment complexes in Massachusetts and New Hampshire agreed to pay $35,000 to a tenant in Nashua who was denied permission to keep an emotional support dog, federal prosecutors said.

The John J. Flatley company was accused of violating the Fair Housing Act by refusing to accommodate the tenant’s disabilities of anxiety and depression, acting U.S. Attorney John Farley said Tuesday.

Without admitting liability, the company agreed to pay the tenant $35,000, enact reasonable accommodation policies for its New Hampshire residential properties and complete training about the housing act.

An attorney for the company was not available for comment Tuesday about the consent decree.