NYU Langone Medical Center and Continuum Health Partners have signed an agreement to formally explore consolidating into what would become one of the largest health-care systems in the city.

“This is by no means a done deal,” NYU spokeswoman Lisa Greiner told The Post.

But both networks will work over the next six to eight months to “hopefully get to a deal,” she said.

The proposed merger has been under discussion for several months by the boards of trustees of NYU, the NYU Langone Medical Center and Continuum, which includes Beth Israel, St. Luke’s and Roosevelt hospitals and the New York Eye & Ear Infirmary, officials said.

Continuum also used to operate the financially struggling Long Island College Hospital in Brooklyn Heights, which is now run by Downstate Hospital.

The boards have agreed to share information in exploring whether to enter into a merger agreement, according to a statement released jointly by NYU Langone and Continuum.

The agreement “would create a new academic health-care system in the City of New York,” the statement said.