While there had been scattered strikes in the Thirteen Colonies prior to the Revolutionary War, America’s labor movement did not take root until the mid-19th century. In fact, during the early years of the United States, labor unions were actually considered illegal—the law treated them as criminal conspiracies—and their members were commonly arrested and put on trial as a result.

Workers continued to form unions despite the legal dangers, and in 1842, the Massachusetts Supreme Judicial Court ruled in Commonwealth v. Hunt that labor unions were legal, legitimate organizations. The ruling opened the door for workers to organize unions such as the National Labor Union, the Knights of Labor, the American Federation of Labor (AFL), and many others, such as the massive railroad brotherhoods. They campaigned for better wages and working conditions as well as a shorter workday, which would ideally be set nationally at eight hours; in time, unions took on new causes, including access to employer-sponsored medical packages and the right to protest the firing of union members.

With the rise of unions came a wave of strikes across the country. Between 1881-1905, there were over 37,000 strikes when workers would walk off the job to protest their employers. In one of the most significant strikes, the Pullman Strike of 1894, the American Railway Union went on strike for better conditions and pay. The strike grew to encompass 250,000 in 27 states, but it failed after President Grover Cleveland ordered the army to disperse strikers. By its conclusion, the strike had caused $80 million in damages and 30 deaths, but it led to the creation of Labor Day as a federal holiday.

However, not all Americans were in a mood to celebrate the labor movement. Public opinion resented union members’ tactics of striking and protesting and the disruptions they caused, especially following the Haymarket Riot of 1884: At a peaceful rally in support of an eight-hour workday in Chicago, an anonymous assailant threw a bomb into the crowd, causing 11 deaths and dozens of injuries. After the incident, men and women across the country came to see union members as dangerous extremists.

Most union workers were skilled male workers living in the nation’s growing cities. Women were largely excluded from union membership, except in more radical organizations, like the Knights of Labor, so women formed their own labor unions when predominantly male unions would not admit them. Many unions also refused to offer membership to African-Americans or foreigners, especially Chinese immigrants.

By the end of the 19th century, the hard work of unions and their members had led to the legalization of unions under Commonwealth v. Hunt, the adoption of an eight-hour day across several industries, acceptance of collective bargaining by employees, and more. In the 20th century, unions would continue the fight for workers’ rights and secure even more benefits for their members.