State Attorney General Letitia James issued a message for Green National, the owners of the Skyline Apartments — fix the problems at your properties or pay up.

“This should be a notice to any and all landlords, and anyone else who tries the same tactics. The office of the attorney general of the state of New York will not tolerate profiting from misery,” James said Tuesday.

The company owned by Troy Green and his father, former NFL football star Tim Green, has 60 days to tackle all code violations at all of its properties.

If not, the company must pay a $300,000 fine.

“No one should live in these conditions, particularly vulnerable and marginalized populations. It is unacceptable,” James said.

The agreement came after the AG’s office opened an investigation into Green National properties in March.

It was reached to try and prevent a lawsuit by the attorney general’s office against the company. A lawsuit could stop Green National from being able to sell its properties, something the AG urged the company to do.

“And I hope they would consider selling all of the properties, because they’re obviously very bad at managing properties,” said James.

City officials have said the company is in the midst of a contract to sell. Per the agreement with the AG’s office, should Green National enter a sale with open code violations, there must be a provision in the contract stating the new owners will address them.

The action against the company inspired Skyline tenants.

“We got hope. We have hope," Skyline Apartments Tenants Association President Katrina Weston said. "And everybody’s working on this. Everybody’s working hard to hold them accountable. If this doesn’t work, then the next plan of action goes into place.”

Green National must notify the AG’s office of any sale or purchase of property in the state over the next five years.