Three Good Samaritans, including an off-duty NYPD captain, jumped in the East River on Wednesday morning to rescue a man who had jumped in, police said.

The emotionally disturbed man was acting erratically on the riverbank near East 10th Street before he jumped in at 7:20 a.m., police said.

Seeing this, two civilians and Capt. Gary Messina, jumped into the chilly water to try to save him. Messina has been in the department for more than 30 years and currently works in a Manhattan detective bureau, police said.

The NYPD harbor unit then responded and pulled all four people onto the boat, taking them to the pier at 34th Street.

The three Good Samaritans received medical attention at the scene, police said. The man who jumped, who is in his 40s, was taken to Bellevue Hospital Center in stable condition for treatment and evaluation, police said.