Medford is a hamlet and census-designated place in the Town of Brookhaven. The community is served by the Patchogue-Medford School District. The Long Island Rail Road was the initial pioneer of Medford. Tracks were laid in 1843 connecting the a flat wilderness area of the Central Long Island Pine Barrens to Patchogue and Port Jefferson stations. In 1855, the LIRR auctioned off the land surrounding the station, but the Long Island Rail Road had to build a farm itself to demonstrate that the land was arable.