Here's a very rough outline:
1) In the US (1776-1840), informal (home teaching) of the three R's and Bible study. Also, Protestant Church schools doing the same thing. A few Catholic schools exist, mostly seminaries. Schooling usually ended by age 10 or 12. Between 1800-1840 school funding began to come from towns.
2) Prussia introduces the world to compulsory government schooling around 1810 following Fichte's "Address to the Prussian People." Students are marched into school at bayonetpoint. The Prussian system provides a classical education to the elite 1%, a professional education to another 5%, and an anti-intellectual education to the remaining school-age population.
3) Horace Mann (a utopian/socialist) and several others (industrialists, psychologists) begin to militate for the establishment of compulsory government schools in Massachusetts based on the Prussian system. Mann presents several reports to the Massachusetts Board of Education. Report #7 extolls the virtues of the Prussian schools that were in recess when he visited. He never saw a Prussian school in operation. (Report #6 extolled the virtues of phrenology, the pseudo-scientific association of personality traits with bumps on the skull).
4) Massachusetts experiences massive waves of Irish immigration in the 1840s and 1860s to the displeasure of the dominant non-Catholic population. This anti-immigrant atmosphere gives rise to the American Party or the Know Nothings as they're more commonly known.
5) To force Catholics into the quasi-Protestant government schools, in 1852 the nation's first compulsory attendance law is passed in Massachusetts. In response, Catholics set up their own school system that is still with us today.
The Know Nothings also add language to the state constitution prohibiting "state aid to private (i.e. Catholic) schools and hospitals." This amendment is added to every state constitution admitted to the union thereafter. They are called "Blaine amendments" named after the speaker of the House of Representatives.
6) In 1885 the militia is sent into Barnstable County Massachusetts to keep order as Barnstable County becomes the last county in Massachusetts to adopt compulsory attendance laws.
7) Compulsory attendance laws spread through the northeast. In Pennsylvania at the turn of the century many schools are burned down.
John Taylor Gatto outlines the history in his book The Underground History of American Education