Born in Watkins, Minnesota, McCarthy became an economics professor after earning a graduate degree from the University of Minnesota. He served as a code breaker for the United States Department of War during World War II. McCarthy became a member of the Minnesota Democratic–Farmer–Labor Party (the state affiliate of the Democratic Party) and in 1948 was elected to the House of Representatives, where he served until being elected to the Senate in 1958. McCarthy was a prominent supporter of Adlai Stevenson II for the Democratic presidential nomination in 1960 and was himself a candidate for the Democratic vice-presidential nomination in 1964. He co-sponsored the Immigration and Nationality Act of 1965, though he later expressed regret about its impact and became a member of the Federation for American Immigration Reform.