ALBANY — Twenty-eight top officials of the scandal-scarred State Police were secretly given pay hikes as high as 18 percent last month, even as then-Gov. David Paterson warned of a $9 billion budget gap and prepared to fire 900 workers, The Post has learned.

The stunning raises cost taxpayers nearly $600,000 and were authorized by acting State Police Superintendent John Melville, who received a $20,394-a-year hike, to $179,756.

Gov. Cuomo’s nominee as State Police superintendent, former NYPD Deputy Chief Joseph D’Amico, filled that post on Jan. 4, pending Senate confirmation.

A Cuomo spokesman said D’Amico’s salary should have been set at the far lower rate required by law for the superintendent, $136,000 annually, and would be adjusted immediately.

State Police officials justified the hikes by claiming a newly negotiated contract increased salaries of majors to an amount equal to or higher than the pay received by their supervisors.

Assistant Deputy Superintendent Terence O’Mara contended in a letter to Paterson’s office that the inequity would make it difficult to promote majors “without undue hardship to those personnel who have shown they possess the best qualities of leadership.”

fredric.dicker@nypost.com