A municipal hospital worker got a single assignment on an overnight shift last year: Monitor an elderly patient to ensure that his ventilator kept working.

But the worker, a 17-year veteran, now faces the ax for allegedly silencing the alarm on the lifesaving ­device — so she could get some shut-eye.

The stunning case was detailed in official documents, where an administrative judge said surgical aide Angelita Williamson should be canned from the Henry J. Carter Specialty Hospital in East Harlem after the “serious breach of her responsibilities” stemming from the incident on Jan. 13, 2015.

Williamson’s colleagues found her sleeping multiple times that night with the lights off, covered in a sheet and partially hidden by a drawn curtain in the patient’s room, documents show.

She was supposed to be watching him all night in what’s known as a “one-to-one observation.”

While one colleague said she witnessed Williamson awake in the patient’s room on several occasions that night, a separate co-worker testified she had to shake and hit Williamson at one point to wake her up.

Another medical staffer reported coming into the room before dawn to find a patient oxygen alarm flashing — but its sound alert had been muted.

Although the patient was unharmed and despite Williamson’s clean employment record of 17 years, Judge Faye Lewis on Oct. 7 recommended that Williamson be fired.

Williamson has until Friday to contest the ruling, according to hospital officials — who sought her termination but can’t take ­action until she has had an opportunity to respond.

Her lawyer, Richard Washington, said, “I was disappointed that after 17 years on the job that she wasn’t given the benefit of the doubt, particularly when there were so many other health-care professionals in the vicinity at the time of the incident.”

Hospital officials said Williamson is still on the payroll pending the final outcome of her case, but is not providing direct care to patients.