After military service as commander of Motor Torpedo Boats PT-109 and PT-59 during World War II in the South Pacific, Kennedy represented Massachusetts's 11th congressional district in the U.S. House of Representatives from 1947 to 1953 as a Democrat. Thereafter, he served in the U.S. Senate from 1953 until 1960. Kennedy defeated Vice President and Republican candidate Richard Nixon in the 1960 U.S. presidential election. At age 43, he was the youngest to have been elected to the office, the second-youngest president (after Theodore Roosevelt), and the first person born in the 20th century to serve as president. To date, Kennedy has been the only Roman Catholic president and the only president to have won a Pulitzer Prize.
Events during his presidency included the Bay of Pigs Invasion, the Cuban Missile Crisis, the Space Race—by initiating Project Apollo (which would culminate in the moon landing), the building of the Berlin Wall, the African-American Civil Rights Movement, and increased U.S. involvement in the Vietnam War.
Kennedy was assassinated in Dallas, Texas on November 22, 1963. Lee Harvey Oswald was accused of the crime and arrested that evening. Jack Ruby shot and killed Oswald two days later, before a trial could take place. The FBI and the Warren Commission officially concluded that Oswald was the lone assassin.
Since the 1960s, information concerning Kennedy's private life has come to light. Details of Kennedy's health problems with which he struggled have become better known, especially since the 1990s. Although initially kept secret from the general public, reports of Kennedy being unfaithful in marriage have garnered much press. Kennedy ranks highly in public opinion ratings of U.S. presidents but there is a gap between his public reputation and his reputation among academics.