In 1960, John F. Kennedy was elected president. After he asked Robert A. Lovett to be his Defense Secretary, Lovett said no but recommended McNamara. McNamara was considered for both the Defense and Treasury Secretaries even though he was (and was for his entire life) a member of the Republican Party (Kennedy was a Democrat). He wasn't interested in being Treasury Secretary but eventually decided to be Kennedy's Secretary of Defense.