The landlord and manager of a Commack apartment complex have agreed to pay hundreds of thousands of dollars and change its business practices to settle a federal housing discrimination lawsuit filed by seven African-American men and women who said they were denied access to rental apartments based on their race.

Square Realty Group, owner of the 107-apartment complex at 11 Mayfair Gardens, and its manager, Empire Management America Corp., both of Manhattan, have agreed to pay $230,000 in damages and take steps to end their discriminatory practices.

Among the changes mandated by the court, the landlord and its manager will advertise apartments on the Internet when they become available for rent and will not charge prospective tenants a broker’s fee.

“This kind of discrimination not only deny African-Americans access to housing, but it also denies their children access to high-quality public schools,” said Elaine Gross, president of Syosset-based ERASE Racism, which also sued.

In 2002, ERASE Racism released a report that showed as a result of housing segregation, a majority of African-Americans and Hispanic children living on Long Island were channeled into 14 low-performing school districts, Gross said.

In the years since ERASE Racism has been working with officials to enforce fair housing laws, Gross said little has been done to end discriminatory preferences. ERASE Racism partnered with Fair Housing Justice Center, a non-profit based in Manhattan, and in 2014 the groups launched an investigation to see whether landlords were abiding by federal and state laws.

Between April and August 2014, the groups sent African-Americans and whites, who posed as prospective tenants, to Mayfair Gardens in Smithtown, a predominantly white enclave in western Suffolk, to look for rentals, Gross said.

advertisement | advertise on newsday

The apartment complex’s proximity to public and private schools, a daycare center, a library, a state park, shopping centers and the Long Island Rail Road make it a desirable place to live.

During the four-month investigation, time and again African-American prospective tenants were discouraged from applying for rentals, according to the lawsuit.

In one instance, John-Martin Green, an African-American man, went to Mayfair Gardens on April 22, 2014, and was told there were no apartments available by May 1, 2014, the day he said he wanted to move in. Green was shown unit 3-2E, but was told the apartment wouldn’t be available until May 15, 2014, and the rent was $1,350 a month.

The next day, April 23, 2014, a white man posing as a prospective tenant was shown the same apartment, 3-2E, but the rent had dropped to $1,300, and the apartment was available for rent on May 1, 2014.

In another instance, a white woman who posed as a prospective tenant arrived at Mayfair Gardens on the afternoon of Aug. 26, 2014. She was shown unit 6-1H and was told it was available for rent on Sept. 7, 2014, or Sept. 15, 2014. The woman left and said she was not interested in renting unit 6-1H.

Eleven minutes later, Angela Scott, an African-American woman, arrived and wanted to rent a one-bedroom or two-bedroom apartment. However, Scott was told there were no apartments available for rent.

Messages left at Mayfair Gardens and an attorney for the landlord were not returned.

The settlement, signed off by U.S. District Court Judge Naomi Reice Buchwald in Manhattan on Feb. 25, will remain in effect for three years.