Several years ago, Joel and Aaron Israel, two brothers who own residential buildings in Brooklyn, decided to increase their profits by replacing rent-regulated tenants with residents willing to pay much higher amounts.

To that end, prosecutors in Brooklyn said, the two resorted to acts of skulduggery. They destroyed apartments. They hired people to intimidate residents. They built a wall that stopped a tenant from entering his apartment. Sabotage to one of their properties prompted New York City officials to order the entire building emptied of tenants.

In State Supreme Court in Brooklyn on Tuesday, the Israel brothers pleaded guilty to engaging in a scheme to defraud as well as three counts of unlawful eviction. They can avoid going to prison if they adhere to the terms of a plea agreement that requires them to pay restitution to tenants and follow requirements established by the city’s Department of Housing Preservation and Development and the state’s Homes and Community Renewal agency.

“If you do all these things, then the promise is after six months I will sentence you to five years’ probation and you will perform 500 hours of community service,” Justice Danny K. Chun told the men. “If the conditions are not met, the individual defendants, both of you, face one and a third to four years in jail.”