On February 2, 1789, James Madison defeated Monroe in election to U.S. House of Representatives. The campaign was more of a forum on the new Constitution; the two candidates traveled the district together, with Madison praising the new government and Monroe calling for the addition of a Bill of Rights. Monroe would be elected to the U.S. Senate the following year, and would serve two terms.
Monroe first met Madison when Monroe was a member of the Continental Congress and Madison was in the House of Delegates. The two were usually friends, but rivalry would cause rifts in their friendship several times. A second time was when they would run against each other for president in 1808. In this second case, their disagreement was over relations with Great Britain: Monroe favored diplomacy while Madison was a proponent of economic coercion.
However, when Monroe was elected president in 1817, he spoke highly of his predecessor: “Of [him], under whom so important a portion of this great and successful experiment has been made, I shall be pardoned for expressing my earnest wishes that he may long enjoy in his retirement the affections of a grateful country, the best reward of exalted talents and the most faithful and meritorious services.” (From Monroe’s first inaugural address, 4 March 1817.)