Kennedy was born in Brookline, Massachusetts, and graduated from Harvard University in 1940, before joining the U. S. Naval Reserve the following year. During World War II, he commanded a series of PT boats in the Pacific theater and earned the Navy and Marine Corps Medal for his service. After the war, Kennedy represented the 11th congressional district of Massachusetts in the U. S. House of Representatives from 1947 to 1953. He was subsequently elected to the U. S. Senate and served as the junior Senator from Massachusetts from 1953 to 1960. While in the Senate, Kennedy published his book Profiles in Courage, which won a Pulitzer Prize for Biography. In the 1960 presidential election, he narrowly defeated Republican opponent Richard Nixon, who was the incumbent vice president.