The entities, based largely on the territories held by the two warring sides at the time, were formally established by the Dayton peace agreement in 1995 because of the tremendous changes in Bosnia and Herzegovina's ethnic structure.