Hanson took dozens of books last year — many of them valuable graphic novels — from at least two libraries on East Houston Street and North End Avenue in Manhattan.

He was sentenced in Manhattan Supreme Court on Wednesday to serve 2 1/2 years to five years on his plea to felony burglary.

Yesterday, the misdemeanor theft charge against him was dismissed in Manhattan Criminal Court, as that charge was covered by his felony plea, officials said.

Hanson won headlines last September when he was tackled and held for cops by brave and wily East Village book seller Donald Davis.

The owner of East Village Books at 99 St. Marks Place, Davis told The Post that he was suspicious that Hanson was dealing in hot books.

Davis told employees to call him with a coded message — “Where’s my delivery?” — if Hanson returned to the store to sell any books.

Hanson did return to the store, an employee called Davis with the coded message, and Davis, a former high school wrestler, rushed to the store, tackling Hanson and holding him for cops.

Hanson reportedly worked in the publishing industry before developing a drug problem, and last lived in a halfway house downtown. He has also spelled his name Hansen, and has a rap sheet of drug, weapons and burglary arrests stretching back to 2003.