JFK's political career began where he had been born–in Massachusetts, where his father had numerous contacts, and where a prominent seat in the House of Representatives had just become vacant. For a time, there was talk of JFK's running for lieutenant-governor, but in the end he settled on running for the House's Eleventh District, a sprawling area that included much of East Boston and Cambridge. Save for Harvard University and its surroundings, the Eleventh was a poor district, filled with factories, railway yards, and dumps, and teeming with Irish and Italian immigrants. It was a heavily Democratic district, so the key to winning the election lay in winning the Democratic primary. To that end, Joseph Kennedy, Sr. pulled out all the stops. Using his connections in the Boston newspapers, he played up his family's charitable work, their staunch Catholicism, and JFK's status as a war hero. A fortune was poured into streetcar advertising for the young candidate, and local politicians were mobilized to lend their support.
JFK's opponents accused him of being a rich, spoiled carpetbagger, slumming for votes in a poor district, but no one could doubt his energy and enthusiasm. Gaunt and pale from his long illnesses, he nevertheless made countless appearances and speeches around the district, marched in parades, and canvassed the district, shaking hands and asking for votes. "We took him out to taverns," a local organizer named Pat Mulhern said later, "we took him in hotels, we took him up to the South End, we met 'em on street corners, we took him in clubrooms. We took him every place." Exhausted and ill with a fever, JFK took the primary easily on June 17, 1946. The fall election was a formality–JFK swept past the Republican candidate, and in January of 1947 entered Congress as the "gentleman from Massachusetts."
The political landscape was changing when JFK reached Washington. World War II was over, and Franklin Delano Roosevelt was dead. President Harry Truman was doing his best to expand the liberal social programs of his predecessor, but he faced staunch opposition from a coalition of Southern Democrats and Republicans, who anticipated winning the White House in the 1948 election. (In actuality, Truman would eke out a narrow, comeback victory over Republican Thomas E. Dewey.) It took some time for the inexperienced and youthful-looking JFK to find his footing in the capital. During his first term, he hewed close to the Democratic party line on domestic policy, voting against reducing funding for school lunches, opposing the weakening of rent control, mobilizing veteran support for a housing bill that failed to pass, and supporting attempts to raise the minimum wage. During this time, he served on the House Education and Labor Commission, as one of the two most junior members. The other was a California Republican named Richard Nixon. Only on foreign policy did he buck the party line. When China fell to the Communist armies of Mao Zedong in early 1949, JFK denounced the Truman government for its inaction, joining a chorus of voices that accused the administration of having "lost China."
Meanwhile, during JFK's first term in office, the root of his constant illness was finally discovered. He fell ill on a trip to England in the fall of 1948, and while the press was told that this was a recurrence of his war-time malaria, JFK had in fact been diagnosed with Addison's Disease. This incurable ailment was often fatal (one doctor predicted in 1948 that JFK had only a year to live), since it involved an impairment of the adrenal glands, and a weakening of the immune system. Treatment with cortisone injections improved JFK's health, enabling him to gain weight and improve his skin color, but for the rest of his political career (and life) his health was fragile. JFK and his family worked hard to keep his Addison's Disease a secret, aware that public knowledge of such a condition would probably torpedo his chances of political advancement.
Reelected to a second term in the House in 1948, and then a third in 1950, JFK gradually became more comfortable in Washington. His health improved, and he entered the capital's social scene, enjoying usually brief romantic liaisons with numerous women. In the realm of politics, the Cold War, the struggle for global power between the U.S. and the U.S.S.R., had become the dominant political issue of the day. After the debate over China, JFK emerged as a consistent, if unpredictable, critic of the Truman administration's foreign policy. Meanwhile, he had become friends with a freshman senator from Wisconsin, a Republican named Joseph McCarthy. It was McCarthy who, in February 1950, made a speech in which he claimed to have information indicating that over two hundred employees of the State Department were members of the Communist Party. So began the era of "McCarthyism," in which fears (later proved to be somewhat justified) of Russian spying on the U.S. served as the grounds for an unprecedented witch-hunt aimed at rooting out "Reds." During this time, Richard Nixon became famous for chairing congressional hearings that unmasked a Communist spy named Alger Hiss. Meanwhile, overseas, the Communist threat became more real with U.S. involvement in the Korean War (1950-53), in which Communist North Korea attempted to conquer U.S.-backed South Korea. But McCarthy himself overreached, and his career became a byword for repression, paranoia, and insidious gossip-mongering. While JFK never played an active role in the witch-hunts, he also never condemned McCarthy strongly, and many Democrats would hold that against him for years.
Nevertheless, JFK felt sufficiently secure in his popularity to mount a run for the U.S. Senate from Massachusetts in 1952. He was up against Henry Cabot Lodge, Jr., a Republican and a member of the wealthy, Anglo-Saxon, and Protestant elite of New England. The race was a contest, as one writer put it, between the Blue Bloods (the New England aristocracy) and the Green Bloods (the rising, and largely Irish, immigrant class). Again, Joseph Kennedy, Sr.'s money and connections had tremendous impact. It was a Republican year, nationwide, as the popular general Dwight Eisenhower won the presidential election over the Democratic candidate, Adlai Stevenson; Eisenhower's Vice-President was former Congressman Richard Nixon. To the dismay of old Yankee society, however, JFK won in Massachusetts, by just seventy thousand votes, and in January 1953, he was sworn in as a U.S. Senator.