New York University is paying top dollar for its top boss.

Andrew Hamilton, who took the helm of the institution in 2016, received $1.8 million in compensation that year, NYU’s newly released tax filings show.

Hamilton’s base pay of $1,368,434 is likely among the highest in the country for a university president. His 2016 package included an additional $250,000 in deferred compensation, a sum he will receive every year for five years and can collect at the end of that period.

And he doesn’t have to worry about a long commute, with NYU providing a coveted duplex penthouse apartment on Washington Square for him. The university spent at least

$1 million renovating it for Hamilton’s use.

While NYU previously refused to reveal Hamilton’s hefty salary, it had no choice but to divulge it through its tax filings, which must be made public.

Hamilton was vice chancellor at the University of Oxford in England before joining NYU.

Tuition, room and board at NYU this year came to about $70,000, and many students carry heavy debt. The university has come under criticism for the fat pay packages and perks it lavishes on honchos.

NYU and related foundations have provided loans to administrators, including Hamilton’s predecessor John Sexton, so they could buy vacation homes.

A faculty group in 2015 was so incensed, they filed a request to the state Attorney General’s Office to investigate the $685,000 exit package given to Jack Lew, who went on to be US Treasury secretary, when he left his executive vice president’s job at NYU in 2006. Part of the sweet deal included loan forgiveness.

Sexton received $1,242,948 in base salary in 2014. The figure dropped to $605,663 the next year, but then he got a “length of service” bonus of $2.5 million.

Tax filings for 2015 also showed the value of his retirement benefits was $7.5 million.

Sexton received a series of loans for his Fire Island weekend property. He remains a professor at NYU’s law school.

High as it is, Hamilton’s salary actually pales in comparison to that of Dr. Robert Grossman, the dean of NYU’s medical school. The doc’s compensation for that job and for heading NYU Langone hospital came to $7.7 million in 2016, including $2.4 million in bonuses.

NYU spokesman John Beckman said, “The compensation of NYU’s leadership is in line with that of the leaders of other major, urban, private research universities with academic medical centers, and is reviewed and approved by a board committee that is advised by an independent compensation consultant.”