The NYPD captain who left work early instead of going to a Brooklyn hospital following a double cop shooting was demoted Wednesday, The Post has learned.

Scott Forster, 31, was demoted from captain to lieutenant for failing to go to Kings County Hospital after two cops were shot Feb. 20, police sources said.

The NYPD accused Forster of “gross negligence” for not rushing to the hospital after the shootings of cops William Reddin and Andrew Yurkiw in a gun battle with a gang member. The nonfatal shootings occurred 40 minutes before the end of his shift.

With the hospital in his precinct, Forster was expected to coordinate the arrival of police brass, arrange rooms for family members and perform other duties there.

Forster also ignored a series of calls and messages from his bosses afterward, sources said, even claiming it wasn’t his problem.

Forster was stripped of his badge and gun and placed on modified duty. The incident set off an NYPD investigation into his work practices to see if he skipped out on work that day and on “numerous” other occasions, police sources said.

Forster was transferred from his post as second in command of the 71st Precinct to desk duty at the 52nd Precinct in the northwest Bronx as punishment, a much longer commute from his Staten Island home, sources said.

Forster admitted to his superiors that he never personally signed the precinct command log for the 7 p.m.-to-4 a.m. shift and instead ordered a desk officer to sign for him, sources said. The practice is a violation of department rules.

Forster, who attends New York Law School on a fully paid NYPD scholarship, also admitted he “may have left the 71st Precinct prior to the end of his tour” because he was sick to his stomach.

A check of his precinct’s log book turned up “numerous discrepancies” involving him, prompting the investigators to recommend the wider probe, sources said.