Middletown has remained an important government administrative center. From the creation of Middlesex County in 1798 until the elimination of county government in 1965 Middletown was the county seat. Middletown today retains Middlesex Superior Court, and the Judicial District remains that of the former county court. Other county functions were either centralized to the state or transferred to the towns. The former county building has been removed, but there are other state agency buildings elsewhere in the city, such as the Dept. of Social Services on Main Street Ext. Middletown's Probate Court district includes the towns of Cromwell, Portland, Middlefield and Haddam. The city is also the site of the controversial State Juvenile Training Center.