Shirley is a hamlet in Suffolk County, New York, United States. As of the 2000 census, Shirley population was 26,395. It is named for developer Walter T. Shirley who had the vision in the 1950s to turn the area on Mastic Bay into an affordable enclave. Shirley's company priced its 4,000 four-room homes starting at $4,700, and lots were priced at $295. Shirley is a community in the Town of Brookhaven, on the South Shore of Long Island. Shirley is served by the Mastic–Shirley Long Island Rail Road station (the station was a compromise when both Mastic and Shirley campaigned for it). The 7th Precinct of the Suffolk County Police Department is located in Shirley. Most of Shirley, the southern part, is served by the William Floyd School District. The northern part is served by the Longwood Central School District.