Washington chose to retire after serving two terms and, in advance of the 1796 presidential election, Madison helped convince Jefferson to run for the presidency. Despite Madison's efforts, Federalist candidate John Adams defeated Jefferson, taking a narrow majority of the electoral vote. Under the rules of the Electoral College then in place, Jefferson became vice president because he finished with the second-most electoral votes. Madison, meanwhile, had declined to seek re-election, and he returned to his home at Montpelier. On Jefferson's advice, President Adams considered appointing Madison to an American delegation charged with ending French attacks on American shipping, but Adams's Cabinet members strongly opposed the idea. After a diplomatic incident between France and the United States known as the XYZ Affair took place, the two countries engaged in an undeclared naval war known as the Quasi-War.