According to the AIA Guide to New York City, this "dour red-painted institutional remnant" (I guess the red has faded to pink since that was written) was erected around 1840 as the Brooklyn Boys' Boarding School, and later became Public School 15. I think the 1840 date might only apply to the portion of the structure with the peaked roof here on the corner of State Street and 3rd Avenue; as you pass down the block to the left, toward Schermerhorn Street, you encounter three architecturally distinct sections. The taller part of the building at far left, which the NY Times says was once a Civil War infirmary, now houses the relocated Khalil Gibran International Academy, as well as the final senior class of the failed Metropolitan Corporate Academy, while the rest of the complex, as far as I can tell, serves as office space for the city's Board of Education.
(That's the Williamsburgh Savings Bank Tower looming in the rear.)