The first attempts to codify the game of football and turn it into an organised sport were made in English public schools in the mid 19th century. While each school developed its own, unique set of rules, there were two broad schools of thought: Rugby, Marlborough and Cheltenham, for example, favoured a game in which the ball could be carried while Eton, Harrow, Westminster and Charterhouse preferred a kicking and dribbling game.
With the development of the railways in the 1840s it became possible to organise inter-school matches. One half of the game would be played using the "home" school rules and the other under the visitor's rules.
The first unified rules were drawn up at Cambridge University in 1848. The Cambridge Rules were not widely adopted beyond the universities and public schools but would have a significant impact on the Football Association rules some 15 years later.
In the late 1850s football clubs were beginning to spring up throughout the country, most notably Sheffield FC, now recognised as the world's oldest association football club (formed 1857), who devised what became known as the Sheffield Rules. While the university and public school teams catered exclusively for the gentry and aristocracy, these new clubs were the domain of the middle classes.
The Sheffield Rules were widely adopted throughout the north and midlands and introduced several innovations that would later be taken up in Association Football including free-kicks, corner-kicks, handball, throw-ins and the crossbar.
In October 1863 representatives of several clubs from the London metropolitan area met to form the Football Association and draw up a single unifying code. The public schools were invited to join but only Charterhouse and Uppingham accepted, the remainder prefering to pursue their own codes. At the fifth meeting a dispute arose when the latest version of the Cambridge Rules was considered for inclusion in the draft FA rules over carrying the ball and hacking. Blackheath FC withdrew and went on to help formulate what would become the Rugby Union code while the FA published their final "Laws of Football" in December 1963.
Both the FA and Sheffield Rules co-existed for the next 14 years with the latter continuing to be widely followed in the north and midlands but the differences narrowed as both codes adopted rules from the other. The success of the FA Cup, first played in 1871, provided the impetus needed for the FA Rules to become universal and in 1877, the FA and Sheffield Rules were unified.
At the same time, labour reforms and the growth of the industrial cities created a new wave of football clubs among the working class that would rapidly eclipse the genteel world of the gentlemen players and usher in organised league football, professionalism and the birth of the modern game.