Bath had long been an ancient borough, having that status since 878 when it became a royal borough (burh) of Alfred the Great, and was reformed into a municipal borough in 1835. It has formed part of the county of Somerset since 878, when ceded to Wessex, having previously been in Mercia (the River Avon had acted as the border between the two kingdoms since 628). However, Bath was made a county borough in 1889, independent of the newly created administrative county and Somerset County Council. Bath became part of Avon when the non-metropolitan county was created in 1974, resulting in its abolition as a county borough, and instead became a non-metropolitan district with borough status.