Four of New York’s most dangerous and troubled youth prisons will be placed under federal oversight, strict new limits will be imposed on the use of physical force by guards, and dozens of psychiatrists, counselors and investigators will be hired under a sweeping agreement finalized on Wednesday between state and federal officials.

The agreement will usher in the most significant expansion of mental health services in years for youths in custody, the vast majority of whom suffer from drug or alcohol problems, developmental disabilities or mental health problems.

Currently, the state does not have a single full-time psychiatrist on staff to treat young offenders.

Guards at the youth prisons, known as youth counselors, will be barred from physically restraining youths except when a person’s physical safety is threatened or a youth is trying to escape from the institution.

Guards will be allowed to use the most controversial method  in which a youth is forced to the ground and held face-down  for at most three minutes, with evaluation by a doctor to follow within four hours.