Although it received its royal charter as a "city incorporate" (actually a borough) in 1722, approximately one-half of Williamsburg was located in James City County for many years. The courthouse function was relocated there from Williamsburg, where the newer but historic 1770 Courthouse building was erected on Market Square. It was replaced in 1933 with a newer building nearby, and the 1770 building, substantially restored in 1989, is today part of Colonial Williamsburg's attractions. Much more recently, another larger facility at 5201 Monticello Avenue, near State Route 199 has become the Williamsburg-James City County Courthouse.