Compass is staking out a new office on the Upper East Side.

The primarily residential brokerage has leased a 5,400 square-foot, three-story townhouse at 962 Madison Ave. on the southwest corner of East 76th Street, where it will open a posh flagship.

The 400 square-foot entrance is mid-block on the first floor and has a huge picture window to promote listings.

Upstairs there are 2,500 feet with 100 feet of windowed frontage on both the second and third floors for statement signage.

The column-free spaces have elevator access, and two skylights provide even more sunshine on the third level.

“The upper floors are so spectacular,” said Nicholas Judson who represented the ownership along with Judson Realty colleague Stuart Ellman.

The asking rent was $1.35 million per year for the entire space.

Most ground floor rents in the area are now $600 per square foot, but some spaces, including in new projects, have garnered twice that in the last few years.

Compass was represented by Steven Soutendjik and Ethan Silverstein of Cushman & Wakefield.

Complementing its residential offerings business, Compass just added a commercial division headed by Adelaide Polsinelli and Robin Abrams.